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: 804185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-83608-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="p/8XULW+"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xbnLg5pLqz9t1t for ; Tue, 22 Aug 2017 07:46:03 +1000 (AEST) 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:cc:subject:in-reply-to:message-id :references:mime-version:content-type; q=dns; s=default; b=nzIUH l1JbV0K3RC9SbQPwKOyqkVfOwJ46NZmkkYYr3SwYQs/lINY23bgZV47DNW7ub/Yp jf1J8pTf7ZBZcsHtABVCrSQs/exBs11H3Ps54tjlzSFQI+4pyJijUtLbPYFT5gQp t098Jt84WI2UUk6AkjRKeK2tmMIkqTK30US3RE= 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:cc:subject:in-reply-to:message-id :references:mime-version:content-type; s=default; bh=T9+j0CrSQkT s9Yb68LVebkUjHPI=; b=p/8XULW+JFTLbV65UevdqIgndpMdU6V6v8Wyr1z+QA9 2jDqTS9NKYtiZBbr+ikeMB0OoQ4/trmZFphUeeGyqI7MMgA9212z0f4b/TJDiUUW Im7DB5iA5betVwdzOP0r9ejh5aSWFSnDP9jufLQYbPlp1I9P+xCGJW+dhW6rhnJY = 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; }