From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Adhemerval Zanella Newsgroups: gmane.comp.lib.glibc.alpha Subject: Re: Fix another -Os strcoll build issue Date: Mon, 26 Feb 2018 15:25:33 -0300 Message-ID: <7a914b3d-14ff-a2b2-0894-756d2f40d39a@linaro.org> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1519669425 24475 195.159.176.226 (26 Feb 2018 18:23:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Feb 2018 18:23:45 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 To: libc-alpha@sourceware.org Original-X-From: libc-alpha-return-90608-glibc-alpha=m.gmane.org@sourceware.org Mon Feb 26 19:23:41 2018 Return-path: Envelope-to: glibc-alpha@blaine.gmane.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=bAgQqMX/r4Nkc418 F/kdjbUUvLjnPJTqSKuRCvfw+cVjpjiBgynk5v97p2o2mQonl4Tj1f/PNU4uQR8O /MzHnc7p1QtnSE1VDA48RtZe1EmSXzHqHj4V5uMVmuG946zqDYIlGdvz4l12pZDQ xCN9mFnIUQj2HhnG6gIgq9UdvOo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=tUkqR++uv9/hsU+kvbrZqB 7IHHU=; b=PF+Ljv6Ax869CjA//jJn+1N0WMSYcuwJTuZsUIeu7WBytMipGDrY+n SDpS0kbDE3yJkfmZtqcFxZ/a0xXnJqsMFnlSXIdiDPlmcsYdYFVNdgk4nio1dZHN mnFZ2Yquvh+IOyBbNcLVcJPceDXTo70/kgT/ii/EVdAn1KkogDNe0= Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Sender: libc-alpha-owner@sourceware.org Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: mail-yb0-f169.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0C6634CyjvFVeGRl8QOJ9ZBu/Fq2c93ZNF9m3CSUI5k=; b=KsxXQ+B24WGiuliwU70sppaDav466aYOZjxJjKc6WJNoQwJHM0I6suL9UV8oSgWRwN Fo+OyYE5lj+tWu/3x2Jmqkk7DNRfRDk7J/orTFil+iEvdM4xTMIUjdt8Lb20V93EQ+ZX x/y1OSUOynSL8LykcrHVfnshY7q5oTyRykst5Q4uJkKmGM9Bb+b31QG1DVT5rQ4G56AR PiFo/eshK+BcDjcxal9uAYV+wkkG9j7UaO9+y0sYyJ3wa7DiP3WQpKn4Q7raOeaNpP2I OrZXHvZCykhNf5hJ0oNkm1IPuwal/LL2gWPWzQPB+J4ePYuAj0isb//2sGpi6cRiUppe d1ew== X-Gm-Message-State: APf1xPAUzaIc1bAEUxp5C3MhIXItRkQQil1C1KCKpqdOClxBvFjUOLsF Rv3quIvnc5/Oh2Qx6wGkIYT1h4EJzA0= X-Google-Smtp-Source: AG47ELtrCg4OJWX3sR/nzKmAD83aOwvMBc9/qwTv1vyKl7RyVPV2nSOA6VAF2EiXOMzUrX1I9FJ0HQ== X-Received: by 2002:a25:3cc4:: with SMTP id j187-v6mr7534477yba.423.1519669537773; Mon, 26 Feb 2018 10:25:37 -0800 (PST) In-Reply-To: Xref: news.gmane.org gmane.comp.lib.glibc.alpha:82940 Archived-At: Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqNR5-0005mx-7s for glibc-alpha@blaine.gmane.org; Mon, 26 Feb 2018 19:23:39 +0100 Received: (qmail 61858 invoked by alias); 26 Feb 2018 18:25:41 -0000 Received: (qmail 61547 invoked by uid 89); 26 Feb 2018 18:25:41 -0000 On 23/02/2018 14:41, Joseph Myers wrote: > While there are now clean -Os build and test results on x86_64 (given > my patch , > pending review), testing with -Os with build-many-glibcs.py shows the > build is still failing with -Os everywhere except for x86_64, x86 and > s390x. > > There are a variety of different build failures, but the most common > seem to be in strcoll / wcscoll, similar to existing such cases where > DIAG_* are used to disable -Wmaybe-uninitialized. There are various > different failures even within those functions. This patch fixes one > particular case that seems quite common, where the warning appears at > the declarations of seq1 and seq2. > > Tested with build-many-glibcs.py that this fixes the -Os build for > aarch64-linux-gnu with GCC 7. > > 2018-02-23 Joseph Myers > > * string/strcoll_l.c: Include . > (STRCOLL): Ignore -Wmaybe-uninitialized for -Os around > declarations of seq1 and seq2. Reviewed-by: Adhemerval Zanella > > diff --git a/string/strcoll_l.c b/string/strcoll_l.c > index 4a63c56..c001ff4 100644 > --- a/string/strcoll_l.c > +++ b/string/strcoll_l.c > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include > > #ifndef STRING_TYPE > # define STRING_TYPE char > @@ -291,7 +292,17 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, locale_t l) > > int result = 0, rule = 0; > > + /* With GCC 7 when compiling with -Os the compiler warns that > + seq1.back_us and seq2.back_us might be used uninitialized. > + Sometimes this warning appears at locations in locale/weightwc.h > + where the actual use is, but on architectures other than x86_64, > + x86 and s390x, a warning appears at the definitions of seq1 and > + seq2. This uninitialized use is impossible for the same reason > + as described in comments in locale/weightwc.h. */ > + DIAG_PUSH_NEEDS_COMMENT; > + DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized"); > coll_seq seq1, seq2; > + DIAG_POP_NEEDS_COMMENT; > seq1.len = 0; > seq1.idxmax = 0; > seq1.rule = 0; >