From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1067B3882100; Fri, 14 Jun 2024 23:59:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1067B3882100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718409576; bh=NrA5Kr6a35bJrhSahmhvRH8TO0sk7nWC/de3wGhG5as=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gNBpei8tz3wyQmYqRDPwWgMN7pF5neG4MuAZwQqu9zKrfD4v6KGsn+C/2cS4a1xDe vqvDxgsQH5utt1NVHmo1l+gTxyZx/Jmh6cwUvEn2sQQ++E2vfS8AU+zFCQIlamqO37 ho0iLNlyWSuFtHrw4rt2Deq5/gYYrhWwOn5ViRnw= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/115492] [15 Regression] wrong code at -O2/O3 Date: Fri, 14 Jun 2024 23:59:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: needs-bisection, wrong-code X-Bugzilla-Severity: normal 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: 15.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on short_desc keywords everconfirmed target_milestone 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=3D115492 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2024-06-14 Summary|[15 Regression] wrong code |[15 Regression] wrong code |at -O2/O3 when compiled |at -O2/O3 |with -fPIC | Keywords| |needs-bisection Ever confirmed|0 |1 Target Milestone|--- |15.0 --- Comment #1 from Andrew Pinski --- Confirmed. -fPIC is just forces f to not to be inlined. Here is a testcase which fails at -O2 but passes at -O0/-O1: ``` int a =3D 2, b=3D0, *c =3D &a, *d =3D &a, e=3D0; [[gnu::noipa]] void f(int) {} [[gnu::noinline]] int h(int *k) { int ***j; if (b) { *j =3D &k; // Note the unintialized j is used here // but since it is conditional and b is always zero, there sho= uld no // effect otherwise. ***j; } f(*k); *d =3D e; return *k; } int main() { if (h(c)) __builtin_abort(); } ```=