From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2152) id 69DF53858D39; Tue, 7 Mar 2023 01:22:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69DF53858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678152128; bh=KKceDdhN26TtAisPP1Y64nAJZYuUe+rz38MpsfJPZy4=; h=From:To:Subject:Date:From; b=FFnXzfr+iXhsPGbPep+RvNajyzdvKxJGQdd1DNLP3geWUEfk2nXabZOxHiAPq3ste bgjCn2zA3OQJoELd305RuHsgrE06Iw1vvUr2RYRYu0ObHu9sNnDpmRYItxziRawIdm tiE/iwoeWWLFv7BIi6bFIgSMiWle8fKSbQFt/inI= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Hans-Peter Nilsson To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-6512] testsuite: Add tail_call effective target X-Act-Checkin: gcc X-Git-Author: Hans-Peter Nilsson X-Git-Refname: refs/heads/master X-Git-Oldrev: 3dd4ada43704115b91e496de2dfbd925443450bc X-Git-Newrev: 7dde02e9efc9d7ecd87814f4c8ee803ef005a7fd Message-Id: <20230307012208.69DF53858D39@sourceware.org> Date: Tue, 7 Mar 2023 01:22:08 +0000 (GMT) List-Id: https://gcc.gnu.org/g:7dde02e9efc9d7ecd87814f4c8ee803ef005a7fd commit r13-6512-g7dde02e9efc9d7ecd87814f4c8ee803ef005a7fd Author: Hans-Peter Nilsson Date: Mon Mar 6 18:00:47 2023 +0100 testsuite: Add tail_call effective target 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. Diff: --- 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 4236c920bae..4bad4dae582 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -11680,6 +11680,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 { } {