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: 1752668 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=uAUnweQM; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PVnlg5QB0z23j7 for ; Tue, 7 Mar 2023 05:53:18 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 92B66385B511 for ; Mon, 6 Mar 2023 18:53:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92B66385B511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678128796; 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=uAUnweQMKaMduocQ2NuQ6ErdLnOQNjYBp9xayIvaizLAfaUf+fLb3TPm8gL8Oz+fF +h8tSuyJOlJbla0wvIPYVDhe8bw6dQ1o943W/FtMd/R3GKX+c/LnpcFpBGgN7KeXNj QBN3p5Tv2KeeF4kf3s1W/RRbiS0S/kOHDbq75WM4= 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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.