From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Joseph Myers Newsgroups: gmane.comp.lib.glibc.alpha Subject: Fix two more -Os strcoll / wcscoll build failures Date: Mon, 26 Feb 2018 21:53:18 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Trace: blaine.gmane.org 1519681888 32352 195.159.176.226 (26 Feb 2018 21:51:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Feb 2018 21:51:28 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) To: Original-X-From: libc-alpha-return-90641-glibc-alpha=m.gmane.org@sourceware.org Mon Feb 26 22:51:24 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:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=rsQ7j/wR2x0jD2AQ/FfCDqtitSu/F pfhTmuaJgW9nO4+IewdC+wkIWz7n+fEDqlkubSe9YhejUQy5LqqLhPUUgMb2urkY 0GxEuX4DqrF2yDdvkeJrM1Peh/6MMgfu6JR0sVC/Hap98p9Iri0L+FgVlRDKH3W4 rt6klorZjFYEd4= 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:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=ndIk67qbrDZmfmE/9o/Vuzu36Kg=; b=NUF e5Q+61LsAK6toGRo+IcNl55VZve+eJiIRgwZPy4POvnfaug/swCuUpRABuFi8Fg4 BTrkUv19sAx9JfWr3PflSFzkoqISeU1dzvAuLOqYXMIlqTRXfWXE0lLirfpz8USi FwUM0Tx5JGbLv0H4wmfoWXb/qVZVaIpJoFF0fG0Q= 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=-24.5 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: relay1.mentorg.com X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) Xref: news.gmane.org gmane.comp.lib.glibc.alpha:82973 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 1eqQg7-0007wY-E1 for glibc-alpha@blaine.gmane.org; Mon, 26 Feb 2018 22:51:23 +0100 Received: (qmail 108554 invoked by alias); 26 Feb 2018 21:53:26 -0000 Received: (qmail 108541 invoked by uid 89); 26 Feb 2018 21:53:25 -0000 Continuing fixes for -Os build issues shown with build-many-glibcs.py, this patch adds uses of DIAG_* to disable -Wmaybe-uninitialized in two more places where code inlined from strcoll / wcscoll is wrongly diagnosed as possibly using uninitialized structure fields. (All these warnings in different places for these functions are I think essentially the same bug.) Tested with build-many-glibcs.py for alpha-linux-gnu and mips-linux-gnu that this fixes the -Os build failures for those configurations with GCC 7. 2018-02-26 Joseph Myers * locale/weightwc.h (findidx): Ignore -Wmaybe-uninitialized for -Os in two more places. diff --git a/locale/weightwc.h b/locale/weightwc.h index ac25ba9..36c65b5 100644 --- a/locale/weightwc.h +++ b/locale/weightwc.h @@ -28,7 +28,15 @@ findidx (const int32_t *table, const wint_t *extra, const wint_t **cpp, size_t len) { + /* With GCC 7 when compiling with -Os the compiler warns that + seq1.back_us and seq2.back_us, which become *cpp, might be used + uninitialized. This is impossible as this function cannot be + called except in cases where those fields have been + initialized. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized"); wint_t ch = *(*cpp)++; + DIAG_POP_NEEDS_COMMENT; int32_t i = __collidx_table_lookup ((const char *) table, ch); if (i >= 0) @@ -107,11 +115,18 @@ findidx (const int32_t *table, continue; } + /* With GCC 7 when compiling with -Os the compiler warns + that seq1.back_us and seq2.back_us, which become usrc, + might be used uninitialized. This is impossible for the + same reason as described above. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized"); if (cp[nhere - 1] > usrc[nhere -1]) { cp += 2 * nhere; continue; } + DIAG_POP_NEEDS_COMMENT; if (cp[2 * nhere - 1] < usrc[nhere -1]) { -- Joseph S. Myers joseph@codesourcery.com