From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 355213858422; Fri, 26 Nov 2021 00:31:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 355213858422 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103432] [12 regression] libjxl-0.5 is miscompiled, works fine with -fno-ipa-modref Date: Fri, 26 Nov 2021 00:31:16 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed target_milestone keywords cf_known_to_work bug_status cf_reconfirmed_on assigned_to cc 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2021 00:31:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103432 Jan Hubicka changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Target Milestone|12.0 |--- Keywords|wrong-code | Known to work|11.2.0 | Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2021-11-26 Assignee|unassigned at gcc dot gnu.org |hubicka at gcc dot = gnu.org CC| |hubicka at gcc dot gnu.org Component|ipa |tree-optimization --- Comment #1 from Jan Hubicka --- It fails with=20 ./xgcc -B ./ -O2 d.ii -fdbg-cnt=3Dipa_mod_ref_pta:189 -fdump-tree-all-deta= ils -fdump-ipa-all-details and works ./xgcc -B ./ -O2 d.ii -fdbg-cnt=3Dipa_mod_ref_pta:188 -fdump-tree-all-deta= ils -fdump-ipa-all-details The difference in optimized dump is: int main () { struct DCTFrom D.11418; @@ -2805,12 +2810,7 @@ float x[4]; struct DCTTo D.11356; struct DCTFrom D.11355; - float _3; - float _4; - double _6; struct FILE * stderr.3_8; - double _9; - struct FILE * stderr.4_11; float _12; float _13; double _15; @@ -2996,30 +2996,10 @@ {anonymous}::IDCT1DWrapper.constprop<4, 1, {anonymous}::DCTFrom, {anonymous}::DCTTo> (&D.11400, &D.11356); D.11400 =3D{v} {CLOBBER}; D.11356 =3D{v} {CLOBBER}; - _3 =3D out[2]; - _4 =3D _3 - 1.0e+0; - actual_accuracy_5 =3D ABS_EXPR <_4>; - if (actual_accuracy_5 > 9.999999974752427078783512115478515625e-7) - goto ; [0.04%] - else - goto ; [99.96%] - - [local count: 429325]: - _6 =3D (double) actual_accuracy_5; stderr.3_8 =3D stderr; - fprintf (stderr.3_8, "ERROR: Too low accuracy: exp=3D%f act=3D%f\n", 9.999999974752427078783512115478515625e-7, _6); + fprintf (stderr.3_8, "ERROR: Too low accuracy: exp=3D%f act=3D%f\n", 9.999999974752427078783512115478515625e-7, 1.0e+0); exit (1); - [local count: 1072883004]: - _9 =3D (double) actual_accuracy_5; - stderr.4_11 =3D stderr; - fprintf (stderr.4_11, "OK: Good accuracy: exp=3D%f act=3D%f\n", 9.999999974752427078783512115478515625e-7, _9); - x =3D{v} {CLOBBER}; - out =3D{v} {CLOBBER}; - coeffs =3D{v} {CLOBBER}; - scratch_space =3D{v} {CLOBBER}; - return 0; - } And I suppose we are not expected to optimize out the "Good accuracy" messa= ge :) So it looks out is modified by {anonymous}::IDCT1DWrapper.constprop<4, 1, {anonymous}::DCTFrom, {anonymous}::DCTTo> (&D.11400, &D.11356); but for some reason ipa propagation gets no_indirect_clobber for param1. T= his seems wrong since to->data is written to, so it is an indirect clobber. I may be able to look more into this only tomorrow - it is bit late.=