From patchwork Tue Dec 3 20:47:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 1203837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107681-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="MeTDwEIX"; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="IjsPTs2y"; 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 47SDZg5f2Tz9sPh for ; Wed, 4 Dec 2019 07:47:55 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=fVO KT51MyynfPCe0FZ4I6omEF57AAR+v/NXk34IdXNpS1X6w3yExbPXZxZTjkPmMuqb oSFEOr1FUz00gavtuegZvxtUTPECHDnCZ+LfP7K+jokuc3M1WFCDPXXiSUvzZ5XD aIFkwzemYHfKXVp8BjTwCQACE93P9TTQ66tqlOvI= 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:to:from:subject:message-id:date:mime-version :content-type:content-transfer-encoding; s=default; bh=nktkJ6u3/ /mrdXOVr3HkGYGaFs8=; b=MeTDwEIXVilNrl40bC1ErdmJtLEgbkiR2MJ2dAELj erPUYc136+467dKFr8qV4Yd4NyG/rNgP/uC2pfxqU1mY1DY5BTNUEtko5DIxcdhg Ci529bVGy7blIbwvVNk3uaoNxsVuLkzD61hiOul4Q+1tjKcnk1rh2kNngOv1fYj8 Fo= Received: (qmail 41104 invoked by alias); 3 Dec 2019 20:47:49 -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 41080 invoked by uid 89); 3 Dec 2019 20:47:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575406065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gObwFGy91EwtEyDgupxOs/KsY6HOlPl1O4LiIetzDOY=; b=IjsPTs2yy70945977bIGs6fu1hwz+6WAiEFnM3xbeuHnp0jrYVUEPuquilf9RShbGKe5+r Ln7bswEZWrAR/oR1qlbAbjPAYvYYwIBT8cMiFYjijpcX2XNdTvPhkWfxGOoxf8RKTqQSC0 5vd89289SHLx78OBcMocnccLHeyztHQ= To: libc-alpha From: Carlos O'Donell Subject: [PATCH] Fix build with -march=486 -Os (Bug 25240) Message-ID: <9e41bfdd-c2e6-9fcd-9576-d485aba0d401@redhat.com> Date: Tue, 3 Dec 2019 15:47:41 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 While reviewing bug 25240 I found that -march=486 -Os doesn't build with gcc 9.2.1 because of this problem. Fixing is straight forward, but I'm not sure if undefining NDEBUG like this is the best solution. I wonder if there isn't a pragma we might use here? Thoughts? 8< --- 8< --- 8< In a -march=486 -Os build gcc 9.2.1 issues the following error: tst-assert-c++.cc: In function ‘int do_test()’: tst-assert-c++.cc:66:12: error: unused variable ‘value’ [-Werror=unused-variable] 66 | no_int value; | ^~~~~ tst-assert-c++.cc:71:18: error: unused variable ‘value’ [-Werror=unused-variable] 71 | bool_and_int value; | ^~~~~ The assert has been disabled by -Os leaving the value unused. We never want the assert disabled because that's the point of the test, so we undefine NDEBUG before including assert.h to ensure that we get assert defined correctly. --- assert/tst-assert-c++.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assert/tst-assert-c++.cc b/assert/tst-assert-c++.cc index 41cb487512..a175f5e961 100644 --- a/assert/tst-assert-c++.cc +++ b/assert/tst-assert-c++.cc @@ -16,6 +16,9 @@ License along with the GNU C Library; if not, see . */ +/* We do not want the compiler or any other pre-included header from + removing the assert we want to test, so undefine NDEBUG right now. */ +#undef NDEBUG #include /* The C++ standard requires that if the assert argument is a constant