From patchwork Mon Aug 21 21:45:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 22294 Received: (qmail 56635 invoked by alias); 21 Aug 2017 21:45:53 -0000 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: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 56048 invoked by uid 89); 21 Aug 2017 21:45:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 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=H*c:HHHH X-HELO: relay1.mentorg.com Date: Mon, 21 Aug 2017 21:45:03 +0000 From: Joseph Myers To: Adhemerval Zanella CC: Subject: Re: Obsolete matherr, _LIB_VERSION, libieee.a In-Reply-To: <5ac84362-3e0b-466f-7245-bcc73a0e47e8@linaro.org> Message-ID: References: <5ac84362-3e0b-466f-7245-bcc73a0e47e8@linaro.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 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) On Mon, 21 Aug 2017, Adhemerval Zanella wrote: > Joseph I am seeing the failure: > > ../sysdeps/ieee754/k_standard.c: In function ‘__kernel_standard’: > ../sysdeps/ieee754/k_standard.c:943:12: error: ‘exc.retval’ may be used uninitialized in this function [-Werror=maybe-uninitialized] > return exc.retval; > ~~~^~~~~~~ > When building 'math/k_standard.o' with GCC 7.1.1 and 8.0.0 (built > with build-many-glibcs.py). with patch on master. GCC 5.4/6.2.1 does > not show this issue. Thanks for pointing this out (my testing was with GCC 6). I've committed this patch to use __builtin_unreachable in a default case to avoid this error. Fix GCC 7 build of k_standard.c. This patch adds a default case to k_standard.c that calls __builtin_unreachable, to avoid an uninitialized variable error from GCC 7 (reported in ). Tested for x86_64 (with GCC 7). 2017-08-21 Joseph Myers * sysdeps/ieee754/k_standard.c (__kernel_standard): Add default case calling __builtin_unreachable. diff --git a/sysdeps/ieee754/k_standard.c b/sysdeps/ieee754/k_standard.c index 0a0201f..8f906bd 100644 --- a/sysdeps/ieee754/k_standard.c +++ b/sysdeps/ieee754/k_standard.c @@ -939,6 +939,9 @@ __kernel_standard(double x, double y, int type) break; /* #### Last used is 50/150/250 ### */ + + default: + __builtin_unreachable (); } return exc.retval; }