From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F1D053882AC9; Tue, 18 Jun 2024 17:26:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1D053882AC9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718731604; bh=fayxjgTiTU9eEteiemv4YDuYKsbUAH5k/GuMt/1o3BQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JYUP9qS9r/a+S2Q/6gel/5LjUiaMQzDE6S3WMgCZIl2XDmc4UsDBc9LCf10Rsoxj7 mYZBQ6HjJ7revjr28krYYugGp6Iimdn8TBEq+Zw6FeMVeQ4paLJ6L792c8JZqT9eUJ AQY/1bTaGxhhugWPsOcXbIn3igyUL1RG7CzjP3Ww= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/115534] intermediate stack use not eliminated Date: Tue, 18 Jun 2024 17:26:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cf_reconfirmed_on bug_status everconfirmed Message-ID: In-Reply-To: References: 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=3D115534 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2024-06-18 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #3 from Andrew Pinski --- Confirmed. Note even without vectorizer turned on we get really bad code from the retu= rn when expanding (just happens the RTL optimizers can remove the load/stores = but not the stack location): ``` ;; return D.4535; (insn 60 59 61 (set (reg:DF 156) (mem/c:DF (plus:DI (reg/f:DI 95 virtual-stack-vars) (const_int -32 [0xffffffffffffffe0])) [4 D.4535+0 S8 A128])) "/app/example.cpp":24:12 -1 (nil)) (insn 61 60 62 (set (reg:DF 157) (mem/c:DF (plus:DI (reg/f:DI 95 virtual-stack-vars) (const_int -24 [0xffffffffffffffe8])) [4 D.4535+8 S8 A64])) "/app/example.cpp":24:12 -1 (nil)) (insn 62 61 63 (set (reg:DF 158) (mem/c:DF (plus:DI (reg/f:DI 95 virtual-stack-vars) (const_int -16 [0xfffffffffffffff0])) [4 D.4535+16 S8 A128]= )) "/app/example.cpp":24:12 -1 (nil)) (insn 63 62 64 (set (reg:DF 159) (mem/c:DF (plus:DI (reg/f:DI 95 virtual-stack-vars) (const_int -8 [0xfffffffffffffff8])) [4 D.4535+24 S8 A64])) "/app/example.cpp":24:12 -1 (nil)) (insn 64 63 65 (set (reg:DF 132 [ ]) (reg:DF 156)) "/app/example.cpp":24:12 -1 (nil)) (insn 65 64 66 (set (reg:DF 133 [ +8 ]) (reg:DF 157)) "/app/example.cpp":24:12 -1 (nil)) (insn 66 65 67 (set (reg:DF 134 [ +16 ]) (reg:DF 158)) "/app/example.cpp":24:12 -1 (nil)) (insn 67 66 68 (set (reg:DF 135 [ +24 ]) (reg:DF 159)) "/app/example.cpp":24:12 -1 (nil)) (jump_insn 68 67 69 (set (pc) (label_ref 0)) "/app/example.cpp":24:12 -1 (nil)) ``` On the stack location we get: ``` sub sp, sp, #64 ``` This is why I said there are a few duplicates there ...=