From patchwork Mon Mar 6 18:52:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 65050 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2014523wrd; Mon, 6 Mar 2023 10:53:41 -0800 (PST) X-Google-Smtp-Source: AK7set+xfg5lXIGmtH4blqF0YmAg8QerWkXwPc2fCIG92raszi4mRbSzUPbFw+lXrCYsFoR7uLTe X-Received: by 2002:a17:907:204c:b0:8b1:7e1a:ef22 with SMTP id pg12-20020a170907204c00b008b17e1aef22mr10905962ejb.45.1678128821303; Mon, 06 Mar 2023 10:53:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678128821; cv=none; d=google.com; s=arc-20160816; b=VgwpU+QPMcquk9zbFuReaDoSJYFXYrUpiqVk8AV5cv3vUYeS3IRtk3mi3MA6YwpVTE Su4wxu0CdZPgjSYxO65Gs+b+5gnMaVOkEbC4858dzKwLLwNLP1Y4k9DoXHcCvMFHHb8a HD+d8ZiHJ1I/NV5T/rSaZoG9kxrL7ULhf58X2S9M8fCO/Fq6Alx4z7VjtOTiCTipGBgo TtOyiCzxNPg4Kqkg6QbQo0dWIYGVGmiNf/MtbtUnMOVmzwkjl1UWPZC1Ask6G3PQqGQb W4OUWiFF9POaQaxHWjvd2hqKo1zW3lZjXRn3KNHXA7ZLHhqKCYvZM3CpygKqin/l7dJl F1Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :references:content-transfer-encoding:mime-version:subject :in-reply-to:to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=CsOxDVRFqTyzjhyd14qr9v0xXwJ21X7Y+KdYeh+o3s8=; b=SgSu3QpGS/K+nYWG1QtiJr2yIT5pK9/j7GnZ15bgggCEMghLiIgfhjeWmtaSIn090X wNLx/GGXolfRBQ0a/qPFm5bM84Ap4sdzzJcOz81hkO0u43433ftXKv8MfBM4dVmUF/tv D5wgjaY0V0AQoPqrWw0sJpe1H5tned/v6X524p0NU8Q0QFGv9Jvx3qtjkcS69BWHho/f yjkoo0bP+peMbRRNTbfPVZo3GubUCKHumSe83VCPqoUY0lp3vOtZMrQq4JJfoau+cqzK ySt4gqn6+u88K+gVltYk0QB1sALnzdF8mUsqlWuJZdNNA9fyUXe2+9aV4PC0v+kLF3/6 Abpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Vjl01Jvm; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id m11-20020a50ef0b000000b004aac683bad9si8905162eds.379.2023.03.06.10.53.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 10:53:41 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Vjl01Jvm; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 20569385AC29 for ; Mon, 6 Mar 2023 18:53:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20569385AC29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678128820; bh=CsOxDVRFqTyzjhyd14qr9v0xXwJ21X7Y+KdYeh+o3s8=; h=To:In-Reply-To:Subject:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Vjl01JvmXE5VAMgMXZJZhNVcoz7jkuLHp5xsNPx3fmByHgxbfy3f0bH5pvNDZn0y4 Sm9VDOkabfO0c8YdH7tSBfMvM9/q6kpgOCw4ECNpihuZm0MjESgb4h0UEBiFKqEZvo 30+HSk/7AcX+i9nBQo7V2TPrw8g1h8PBxpfIpZro= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 9973F3858D39 for ; Mon, 6 Mar 2023 18:52:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9973F3858D39 To: In-Reply-To: <20230306184542.0517B20405@pchp3.se.axis.com> (message from Hans-Peter Nilsson on Mon, 6 Mar 2023 19:45:42 +0100) Subject: [PATCH] testsuite: Support scanning tree-dumps MIME-Version: 1.0 References: <20230306184542.0517B20405@pchp3.se.axis.com> Message-ID: <20230306185255.721FC20405@pchp3.se.axis.com> Date: Mon, 6 Mar 2023 19:52:55 +0100 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759645607113685405?= X-GMAIL-MSGID: =?utf-8?q?1759645607113685405?= This is sort-of a spin-off from effective_target_tail_call: I thought that'd best be implemented by scanning a tree-dump, specifically -fdump-tree-optimized, but the "tail call" found there is emitted for *all* targets. Debugged and ready to apply, putting it out for consideration as someone will need it (or should use it) sooner rather than later... Best committed rather than sitting in mail-archives so: Ok to apply? -- >8 -- No planned usage. * lib/target-supports.exp (check_compile): Support scanning tree-dumps. --- gcc/testsuite/lib/target-supports.exp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 4236c920baeb..0ca7a9680bb4 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -87,6 +87,7 @@ proc check_compile {basename type contents args} { assembly { set output ${basename}[pid].s } object { set output ${basename}[pid].o } executable { set output ${basename}[pid].exe } + "tree-*" - "rtl-*" { set output ${basename}[pid].s lappend options "additional_flags=-fdump-$type" @@ -108,6 +109,9 @@ proc check_compile {basename type contents args} { if [regexp "rtl-(.*)" $type dummy rtl_type] { set scan_output "[glob $src.\[0-9\]\[0-9\]\[0-9\]r.$rtl_type]" file delete $output + } elseif [regexp "tree-(.*)" $type dummy tree_type] { + set scan_output "[glob $src.\[0-9\]\[0-9\]\[0-9\]t.$tree_type]" + file delete $output } # Restore additional_sources.