From patchwork Tue Nov 21 21:24:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 167957 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp923519vqb; Tue, 21 Nov 2023 13:24:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFD+TElXE4kSYUiCHktLXtSQw+nc1Zxb/TtR/cw5q2CLktTXtR1OGyN0RVhJtQMtgWOlati X-Received: by 2002:ac8:5d05:0:b0:41c:b9b6:ec11 with SMTP id f5-20020ac85d05000000b0041cb9b6ec11mr489533qtx.3.1700601873513; Tue, 21 Nov 2023 13:24:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700601873; cv=pass; d=google.com; s=arc-20160816; b=yIfcuOdVUu1M4Kj2GTXpwPox2GnyL/nUIiAL/U0pIGoJ+hff82jiyyw6Ol4wefFPW0 qd2EGXTu0/Zq7+XI28tIHewtTN/RUMIyFhWdTY4NIfCMld9XAlNQqIVKMnScyw8UopO7 xZzdkMYC0SXAE0m88JzcsGpM7307xkr+qBZkAxMgM9jqt7j25U3kpka+yPtXiPwR9+hu OHSI4tFbr+iUx+VtTvMwkKJ6yryxDdz7/HwzKPM/C2/VhLjpOyKHNWxggfgBBEblYgE0 5ooKo6eXbiMUVx7ZLR2nUeuSBsXnr0gTyPwERSeGkZjRlkwTZ/IzsJsTt9iKccVHyEzA 0RdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:references:in-reply-to:subject:to:from:ironport-sdr :arc-filter:dmarc-filter:delivered-to; bh=+kRCgHnAazp7SnAlqmNdzZiWma+bzsPNVTXKMO1UqJ4=; fh=eFkiSZLWwt6NUk89P52s4KbBpZ86lKHrs6ztijECvfM=; b=cgc7qwX485G9qAStcswgvMlrO5ZOLSF9HZIYnSchFu21EtcBVCyZOehWyO5nO3rHfj Guyx1OYCSykIJG/cBPOGiactuFFry5rZs83+lRxP4qA04l0S6aSSWkwixpyCwPhUH5dU kUSUYXF3MdWezKDBe/x+PGc/nWTDg26O0xBHY2FEoa44iDOVPxU0LRKxA2i2ow7+34Rr 4p7wE7xAanq/1ZNsBDB4MOY9XoWDFILvtovIo68LZ6u8VwdTamkBDCrrvZkySSwSdL2p EFWBRDNnkmf6lYx/JSVXb3zqltrpwH1wZ117RBH2Bw2Ga5ppo8puEtGz1WzcwaaBOTKw MONQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n10-20020a05622a040a00b00421f6bb9818si9483637qtx.194.2023.11.21.13.24.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 13:24:33 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2D1713858C30 for ; Tue, 21 Nov 2023 21:24:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id E1D9D3858D33 for ; Tue, 21 Nov 2023 21:24:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E1D9D3858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E1D9D3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.129.153 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700601850; cv=none; b=YWov6SrxkhKuRF/dkx+JjUuQvnYMj8T8vGkLppy+n+2vFS5hMBeb9Jz499BaXR2Pgpkq9ZmwYHvbJ9qkDcOawhdbIz0XzISTIJDqOUtLRMSbG5MmvB23LqiQ6CuNC7JAF8Ck6hDeU2+zJ8/+ZdHRyotA7naFwIBvqv9Keuz1YBk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700601850; c=relaxed/simple; bh=evgsei/Faf9lgx+JTg1QXtigTnRzZZZGroFnQbv86xk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=fRgziFt2wy3p8kpUFwP6llwIb9AjGdzYEQ887HI0V9X2x8Qc/GaKcKmWk4Ki9AbnjNh0+An7ptSNQ3Gj+vRTMzzAsYvcxAoLLvRG585K2rcHKk7AVTc1m5hrdErxHIF70bxKJ9m5YDAYtlLCmhaXgl6F8Pcckh+mRoKOgUddkaM= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: zS/EH7dbTgmtlhUq2KqdEQ== X-CSE-MsgGUID: TUKwjcMuRwuYjn8v6abePA== X-IronPort-AV: E=Sophos;i="6.04,216,1695715200"; d="scan'208,223";a="26425730" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 21 Nov 2023 13:24:07 -0800 IronPort-SDR: +YU0Oy+xX/ObKAG0klbppx9aBPm1eHyyqBB1ZkpSyqRM4sEmL7MLM7+N9WeJIy86wJDXtV0viQ mZf1YtwKle+5q8Mhysqx26ZIs4UdYKXeXIi5zIKMRRMBLczcz2aWrZxQZ11SKhStJ+tVN38/pK lAAo0jItOLGr0DKEpJVBT1+SFAETzOBtg/PWnY9ChIosRvzQMBkcCVAJGq4E9CztRfa+pttL3c ttkRqAKkK2JHYdLJx7aVIV5NHqtpkWrbji+syez/rnqNrejEZrB40cz5Dr5A0GThPspMRimkKg uQw= From: Thomas Schwinge To: Jan Hubicka , Subject: Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char' defaulting to 'unsigned' (was: Propagate value ranges of return values) In-Reply-To: References: <871qcmkmgd.fsf@gentoo.org> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Tue, 21 Nov 2023 22:24:00 +0100 Message-ID: <87r0kiu7f3.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783210310104850291 X-GMAIL-MSGID: 1783210310104850291 Hi! On 2023-11-19T16:05:42+0100, Jan Hubicka wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c Pushed to master branch commit a0240662b22312ffb3e3fefb85f258ab0e7010f4 "Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char' defaulting to 'unsigned'", see attached. On powerpc64le-linux-gnu ('char' defaulting to 'unsigned') I still saw: /tmp/ccd1xwD7.o: In function `test': return-value-range-1.c:(.text+0x50): undefined reference to `link_error' Grüße Thomas > @@ -0,0 +1,22 @@ > +/* { dg-do ling } */ > +/* { dg-options "-O1 -dump-tree-evrp-details" } */ > +__attribute__ ((__noinline__)) > +int a(char c) > +{ > + return c; > +} > +void link_error (); > + > +void > +test(int d) > +{ > + if (a(d) > 200) > + link_error (); > +} > +int > +main(int argc, char **argv) > +{ > + test(argc); > + return 0; > +} > +/* { dg-final { scan-tree-dump-times "Recording return range" 2 "evrp"} } */ ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From a0240662b22312ffb3e3fefb85f258ab0e7010f4 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 21 Nov 2023 22:07:13 +0100 Subject: [PATCH] Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char' defaulting to 'unsigned' ... added in recent commit 53ba8d669550d3a1f809048428b97ca607f95cf5 "inter-procedural value range propagation", fixed in commit 878a860cae78146d98d7a21612f0bcec0930a9c2 "Fix 'gcc.dg/tree-ssa/return-value-range-1.c'". gcc/testsuite/ * gcc.dg/tree-ssa/return-value-range-1.c: Fix. --- gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c index 74f1a5080bb..97294482c05 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c @@ -1,7 +1,7 @@ /* { dg-do link } */ /* { dg-options "-O2 -fdump-tree-evrp-details" } */ __attribute__ ((__noinline__)) -int a(char c) +int a(signed char c) { return c; } -- 2.34.1