From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110550 invoked by alias); 28 Oct 2016 13:04:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 110446 invoked by uid 89); 28 Oct 2016 13:04:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=_overly_, arnd, Arnd, _all_ X-HELO: relay1.mentorg.com Date: Fri, 28 Oct 2016 13:04:00 -0000 From: Joseph Myers To: Carlos O'Donell CC: Florian Weimer , GNU C Library Subject: Re: [PATCH] Fix -Os related -Werror failures. In-Reply-To: Message-ID: References: <6eac682f-26fa-6a47-9497-357206266ba1@redhat.com> <6be7dce5-bfa7-32c7-5bac-6c3b79776683@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2016-10/txt/msg00527.txt.bz2 On Fri, 28 Oct 2016, Carlos O'Donell wrote: > I agree that we can't account for _all_ optimizations someone might want > to disable in their build, but I think it is a reasonable goal to target > a few key _default_ optimization including -O3, -O2, and -Os. And -O1 (bug 19444). And -Og for debuggability. > I agree with Arnd that this code is _overly_ complex and could be > rewritten such that it's a little clearer and makes sense to the compiler > at -Os. In general, making code clearer is a good approach. For -O1 / -Og I'd also be willing to consider default initializers as a less verbose way than DIAG_* macros of making it obvious to the compiler that a variable is initialized (at -Os, that may not be such a good idea because presumably the user cares about saving a few instructions from an unnecessary initialization). -- Joseph S. Myers joseph@codesourcery.com