From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AEC64385C426; Fri, 30 Sep 2022 16:37:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEC64385C426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664555876; bh=BmEHShVgO+2AgWEInyCmP7R/ath4RRmNywUWzshSQ5k=; h=From:To:Subject:Date:From; b=BEX+ISGQq62aPsNsZUPJVozLdDFdljFibo+/nQh6LKxD/iTuwxiIKlEEVmFwD2CvQ op9EFiJGLgiWHBDMRdIwgWTtc6EMQgDPkd3XpTYPl1nVsTEF8V6od4rXJ3/sTHScCA TVPKHo+OxUetV8DMyAP49LPzrHJi7LAZV1k5e+RM= From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107102] New: SVE function fails to realize it doesn't need the frame-pointer in the tail call. Date: Fri, 30 Sep 2022 16:37:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: tnfchris at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107102 Bug ID: 107102 Summary: SVE function fails to realize it doesn't need the frame-pointer in the tail call. Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: tnfchris at gcc dot gnu.org Target Milestone: --- Target: aarch64-* The following example: #include void foo(svbool_t p, svbool_t q); void bar() { foo(svptrue_b32(), svptrue_b8()); } generates at -O2 -march=3Darmv8-a+sve2: bar: stp x29, x30, [sp, -16]! ptrue p1.b, all ptrue p0.s, all mov x29, sp bl foo ldp x29, x30, [sp], 16 ret The tail-call gets de-optimized and GCC fails to realize it doesn't need a frame pointer nor the stack pointer at all. In RTL before frame layout there is no stack usage at all however this look= s to happen because in the expansion there's a clobber on the LR: (call_insn 7 6 10 2 (parallel [ (call (mem:DI (symbol_ref:DI ("foo") [flags 0x41] ) [0 foo S8 A8]) (const_int 0 [0])) (unspec:DI [ (const_int 2 [0x2]) ] UNSPEC_CALLEE_ABI) (clobber (reg:DI 30 x30)) ]) "example.c":6:5 46 {*call_insn} and it, it looks like the expansion missed the sibcall?=