From patchwork Tue Nov 21 11:09:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 167661 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp542204vqb; Tue, 21 Nov 2023 03:09:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQ0UJw8aUa3Y/1POg18P5XfFs+GIwBQrpP0Ta4hqgJmpR2R/QEf6x4Zc3eZXsToELgBq0K X-Received: by 2002:a05:622a:5d3:b0:410:9668:530a with SMTP id d19-20020a05622a05d300b004109668530amr3038448qtb.21.1700564986176; Tue, 21 Nov 2023 03:09:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700564986; cv=pass; d=google.com; s=arc-20160816; b=rR3bL87bjpEAuwVEaito7vYqtG8cD4cAroRWWn2r3PT6UIN1jek6NQgQwgE9RA+7/E ACy3mokALIpWUlSoF7JIdFsr2gKtsRpYrhjs/s1vYzrKCGdihTxo3qh0GwdjQi3dtDTp tjvPfqPmKox+VbZXauBTMxoB21cwGo8Gm6u18fMvtUWyc9rfEIm15GhDI/0hEhRay8IS wuvwZ3lC/VTAbpDnn3fGgwmQvvtZGtsu8NLACSdwlE3+1IOfAVTrunl4X9zaaJXvPq3x pNFCDliJidPAg8vg//ghGmHJvRGmVD3mSAsCY/hEfiV0WiJo8CUt8ekioBa54h5eEh/H Ny8w== 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=GjmjH7q4jdJc8y9HkcNIUxK45vopF0+R3KfO4qtMuqA=; fh=eFkiSZLWwt6NUk89P52s4KbBpZ86lKHrs6ztijECvfM=; b=c1AsPoE8HYolKAF9efpFe+70d4TjzyQftN9Ni7DhF+6zBARcAqUQJBRW4yLwqFvp3u xPB2UbcQjLeV+mlWPxJ9WouYib/nqNP57f5jBpRIIxWNRIvwZSYisqxR/xOMS5J5vgmI JIqXEP1dc9ef/ChV1ujbsd+1SY0Ua8LA/zXizKcPBrVMRbUCPEP3RZV10BnHlbXN5tQ6 u5Middb6HfNtSPcGWRmWCxACrUxgn93MMxbz4brIt/Ri0JCRGXyShSZufXdDyPCJ1v6T OyzWwHP/R9/o2pDqIBEN+BskJTwVTxSRQtO8ktItLzg441piiYlbGrKZN1UiIJsDTbkP I3yg== 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 o19-20020ac85a53000000b00403f3141703si9209763qta.619.2023.11.21.03.09.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 03:09:46 -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 ED04D3858C20 for ; Tue, 21 Nov 2023 11:09:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 785B63858D3C for ; Tue, 21 Nov 2023 11:09:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 785B63858D3C 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 785B63858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.252 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700564963; cv=none; b=x7Nq47qQIv5o3jI7x8+hJglBcJ0kv2lf7MM1VcEPTDibod52fFrSJmktGZ4fPAgpbgXOoDPmIKgwTqOLIrhSjh7chnEhcU6ZDDonREDnY/IU4QknpEeYNRBhnqpqVDqrHx6LFFrPVzA03mOrMTX0Ba3TvrbNbNOBZgjxZK90Eus= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700564963; c=relaxed/simple; bh=5M3NiEH+jZCv08EiYbExxklurG9SJr6Fta4iTnmKqY8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Pe10bZCOO9sJfRiOWXvl7FjsdT7a8H7WQsxNB7U2+3LW+aIN2IzchmurnV/+ksvTSd+Dr5B52gxpSa34LtiBXucskBASYZoiB/VjyLbKklU3tVBDv1/5jBSehP1+Vs2//MEqMCjFhHcGvzuKnd6TJY2hV9DXyhAJqh/049v+aUA= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: h596xsboRm++0EZTqnT17A== X-CSE-MsgGUID: j/IkJr69THKWeMmXI+3bUw== X-IronPort-AV: E=Sophos;i="6.04,215,1695715200"; d="scan'208,223";a="23320498" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 21 Nov 2023 03:09:20 -0800 IronPort-SDR: A+HoMFeQIwUoYf6R8WvOOMPQINlRoHQNJ5T0LmMsa+J+RokZWSrbmg9Ds2mDG24e7BKQ7U+MAp ZGtWvJVSF3lxcbyo34sJOgHr9LMkcIPRwUYfUdwWbCLAGEYURLONq9pFdVnfwl1eSObObDoY9c wF52t0NvfaNU0tV8wxJbfgsxxXRq3ujDBQCWhIpGBvJI8BSh4/5fCEyvbs1nonpQiqop6TNAth vvUNLETCesTZTCDxn0LSFqz04zLfRYxwMy87oCj8Gns2zgFCS7erYYnLU5wSFjG1HkjfZyn3PZ Wr8= From: Thomas Schwinge To: Jan Hubicka , Subject: Fix 'gcc.dg/tree-ssa/return-value-range-1.c' (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 12:09:14 +0100 Message-ID: <87v89v5pnp.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) 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: 1783171630732299139 X-GMAIL-MSGID: 1783171630732299139 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 > @@ -0,0 +1,22 @@ > +/* { dg-do ling } */ ERROR: gcc.dg/tree-ssa/return-value-range-1.c: 1: syntax error for " dg-do 1 ling " With that fixed into 'dg-do link', and... > +/* { dg-options "-O1 -dump-tree-evrp-details" } */ ... that one fixed into '-fdump-tree-evrp-details', I then get: FAIL: gcc.dg/tree-ssa/return-value-range-1.c (test for excess errors) UNRESOLVED: gcc.dg/tree-ssa/return-value-range-1.c scan-tree-dump-times evrp "Recording return range" 2 /tmp/ccTEuffl.o: In function `test': return-value-range-1.c:(.text+0x24): undefined reference to `link_error' This disappears when switching from '-O1' to '-O2'. OK to push the attached "Fix 'gcc.dg/tree-ssa/return-value-range-1.c'"? (..., or did you intend something else, here?) Grüße Thomas > +__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 f3a47339a9df9726da7e3c1daeadc216e1d5b365 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 21 Nov 2023 11:51:42 +0100 Subject: [PATCH] Fix 'gcc.dg/tree-ssa/return-value-range-1.c' ... added in recent commit 53ba8d669550d3a1f809048428b97ca607f95cf5 "inter-procedural value range propagation". gcc/testsuite/ * gcc.dg/tree-ssa/return-value-range-1.c: Fix. --- gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 4db52233c5d..74f1a5080bb 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,5 +1,5 @@ -/* { dg-do ling } */ -/* { dg-options "-O1 -dump-tree-evrp-details" } */ +/* { dg-do link } */ +/* { dg-options "-O2 -fdump-tree-evrp-details" } */ __attribute__ ((__noinline__)) int a(char c) { -- 2.34.1