From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 51E8D3858D33; Mon, 28 Aug 2023 07:18:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51E8D3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693207121; bh=xZGtMjfoyv7OKU/xFKw/itamsTdMFg62UtLaT+X2NJs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LObBz92cU7cgqLY8FES4v5Q80jnAIyvbFMNK2PRAuwLSOJMo39/PfIOSbpoAoldJt UiEsm0vYZdqlVB8mkkF0C8dVG2ijdmAf/zlIaX4eBA9V7jVAXHQGFRAUV/wb4hmLIr BOVlVy48mOOmGa5jkSUpnq96tSLoPo6p2ZK/sYrY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/111157] [14 Regression] 416.gamess fails with a run-time abort when compiled with -O2 -flto after r14-3226-gd073e2d75d9ed4 Date: Mon, 28 Aug 2023 07:18:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jamborm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D111157 --- Comment #5 from Richard Biener --- I think if IPA modref declares the argument dead at the call site then IPA CP/SRA cannot declare it known constant. Now, I wonder why IPA CP/SRA does not replace the known constant parameter with an automatic var like point.constprop.isra (double ISRA.1740, int & restrict ipoint, double & restrict x, double & restrict y, double & restrict z, int & restrict istat) { ... const int istat.local =3D 0; istat =3D &istat.local; ? So if not all uses of 'istat' get resolved we avoid generating wrong code. The expense is a constant pool entry (if not all uses are removed), but I think that's OK. It would also work for aggregates. It would also relieve IPA-CP modification phase from doing anything but trival value replacement (in case the arg isn't apointer).=