From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7DD613858CDA; Tue, 27 Sep 2022 09:10:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7DD613858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664269803; bh=A2rPRvAwO8Izp6RVFWIwer0bEGOeUo2E1/23o4zN12g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NNWI8VT2I0AmEwYgf+khjQYq0hRJgoMA+ufGJJYnWysd1u5vqbT/QWDnPnP22Rc+T jCFJspbvyTJhnpJKaWPoGDZh9Jn0CeJ2zBfbXsv1fN6II8TrM8Quw83DeEHWzN1JfV HaxvBEjOK9CGmy+fYsTyOpvT6/AoVfKfNRicXxLU= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107047] load introduced of struct fields after assigning it to a local variable Date: Tue, 27 Sep 2022 09:10:03 +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: 12.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: bug_status cf_reconfirmed_on keywords cf_known_to_fail everconfirmed component 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=3D107047 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2022-09-27 Keywords| |missed-optimization Known to fail| |12.2.1, 13.0 Ever confirmed|0 |1 Component|rtl-optimization |middle-end --- Comment #1 from Richard Biener --- Confirmed, we see [local count: 1073741824]: f[1][6] =3D g_36; _1 =3D BIT_FIELD_REF ; _8 =3D _1 & 16777215; if (_8 !=3D 0) VN probably sees the def but it doesn't consider replacing the use with a BIT_FIELD_REF of g_36, it just translates the ref but doesn't find any definition to CSE from. SRA says Candidate (1991): f Too big to totally scalarize: f (UID: 1991) Created a replacement for f offset: 848, size: 8: f$1$6$f1D.1996 Access trees for f (UID: 1991): access { base =3D (1991)'f', offset =3D 832, size =3D 64, expr =3D f[1][6],= type =3D struct S6, reverse =3D 0, grp_read =3D 1, grp_write =3D 1, grp_assignment_r= ead =3D 1, grp_assignment_write =3D 1, grp_scalar_read =3D 0, grp_scalar_write =3D 0, grp_total_scalarization =3D 0, grp_hint =3D 0, grp_covered =3D 0, grp_unscalarizable_region =3D 0, grp_unscalarized_data =3D 1, grp_same_acce= ss_path =3D 1, grp_partial_lhs =3D 0, grp_to_be_replaced =3D 0, grp_to_be_debug_rep= laced =3D 0} * access { base =3D (1991)'f', offset =3D 848, size =3D 8, expr =3D f[1][6]= .f1, type =3D char, reverse =3D 0, grp_read =3D 1, grp_write =3D 1, grp_assignment_read = =3D 1, grp_assignment_write =3D 1, grp_scalar_read =3D 1, grp_scalar_write =3D 0, grp_total_scalarization =3D 0, grp_hint =3D 0, grp_covered =3D 1, grp_unscalarizable_region =3D 0, grp_unscalarized_data =3D 0, grp_same_acce= ss_path =3D 1, grp_partial_lhs =3D 0, grp_to_be_replaced =3D 1, grp_to_be_debug_rep= laced =3D 0} but somehow it does not create an access for _1 =3D BIT_FIELD_REF ; _2 =3D (unsigned int) _1; note the real offender here is (again) optimize_bit_field_compare ...=