From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 65AF43858D39 for ; Mon, 6 Mar 2023 18:45:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65AF43858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1678128346; x=1709664346; h=from:to:subject:mime-version:content-transfer-encoding: message-id:date; bh=tilu87pUXTJ8RVGLip2GQbJBesZr20PSgAm1R0jpi7k=; b=nxW8IxuRjE5OjnEUtpGkKjdHcSNwKFiEwUIm1zXe6zqRjzgFMLq4/g2S qJhgVJoKZtXZ5ti/w5ZAzyUHlhOHDXeBWQ1i5YE4rSWfgTZe7LGM/+5TW I3XxvT2GISZvXfCvbPpYQU8sD8iF83+AlKx9Djnec31Zqlo+uToMO5dMT r9OvaqPA55XiFPQOXPMx0Tm1Qy/8l/S+SC7BE/8vl+xHlYlLDshfdjDWS RRvxpbeJ8CwHLGZ12K5oGSxcLiZL5uf2UU9nnS4OM4WyzMzUb7bk5C1ey pUQDLpG/ZIuJsreFrHou/y1FRj0FPbXY/qoEBkre0Zeg5klfeKc3aidCp Q==; From: Hans-Peter Nilsson To: Subject: [PATCH 1/3] testsuite: Add tail_call effective target MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-ID: <20230306184542.0517B20405@pchp3.se.axis.com> Date: Mon, 6 Mar 2023 19:45:42 +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 List-Id: Ok to commit? -- >8 -- The RTL "expand" dump is the first RTL dump, and it also appears to be the earliest trace of the target having implemented sibcalls. Including the "," in the pattern searched for, to try and avoid possible false matches, but there doesn't appear to be any identifiers or target names nearby so this is just belts and suspenders. Using "tail_call" as a shorter and more commonly used term than a derivative of "sibling calls", and expecting only gcc folks to have heard of "sibcalls". * lib/target-supports.exp (check_effective_target_tail_call): New. --- gcc/testsuite/lib/target-supports.exp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 0ca7a9680bb4..958537b3b7c0 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -11684,6 +11684,15 @@ proc check_effective_target_frame_pointer_for_non_leaf { } { return 0 } +# Return 1 if the target can perform tail-call optimizations of the +# most trivial type. +proc check_effective_target_tail_call { } { + return [check_no_messages_and_pattern tail_call ",SIBCALL" rtl-expand { + __attribute__((__noipa__)) void foo (void) { } + __attribute__((__noipa__)) void bar (void) { foo(); } + } {-O2 -fdump-rtl-expand-all}] ;# The "SIBCALL" note requires a detailed dump. +} + # Return 1 if the target's calling sequence or its ABI # create implicit stack probes at or prior to function entry. proc check_effective_target_caller_implicit_probes { } { -- 2.30.2