From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 08B4E3858408; Fri, 3 Feb 2023 23:15:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08B4E3858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675466139; bh=LZmV5WlkV/QBheI6hEjCMJRxcNO/HhJyo/EuCcz5QgM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fEYwLuCZWAJsj3eT66yK/vWYohTFma0oQNjfjVe9RAXbSurNHMt3k7io3IjAZ4pii 0qFkLvtTW2ZX23+iTdQkJiRYCIeETjGUZ+1XvLo2KNcXVQaIYczVwmEP4KXZJvd1x1 HJ6JT57jE8XI+2uuwoGM9pOtPnWq0bHzkzNhqJ7c= From: "vmakarov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/103541] unnecessary spills around const functions calls Date: Fri, 03 Feb 2023 23:15:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: vmakarov 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: cc 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=3D103541 Vladimir Makarov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vmakarov at gcc dot gnu.org --- Comment #4 from Vladimir Makarov --- Honza, thank you for reporting this. Fixing just the following code will n= ot solve the problem as LRA uses only equiv expression valid for the whole function. > ret =3D valid_combine; > if (!MEM_READONLY_P (memref) > && !RTL_CONST_OR_PURE_CALL_P (insn)) > return valid_none; >=20 By the way, the old reload pass still works on the test and producing the s= ame code as LRA currently, also reserving stack slot and using it around the ca= ll instead of reload from a. I've been working on this problem and I hope the fix will be ready on the n= ext week.=