From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1D33D385481D; Tue, 16 Feb 2021 07:59:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D33D385481D From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/99117] [9/10/11 Regression] cannot accumulate std::valarray Date: Tue, 16 Feb 2021 07:59:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: needs-reduction, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Tue, 16 Feb 2021 07:59:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99117 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Component|middle-end |libstdc++ --- Comment #2 from Richard Biener --- FRE5 does [local count: 2736164397]: # ivtmp.143_71 =3D PHI _221 =3D (void *) ivtmp.143_71; _124 =3D MEM[(int * *)_221 + 8B]; - _115 =3D MEM[(const int &)_101]; _162 =3D MEM[(const int &)_124]; - _140 =3D _115 + _162; - *_101 =3D _140; + *_101 =3D _162; __p_61 =3D _101 + 4; _127 =3D _124 + 4; - _131 =3D MEM[(const int &)__p_61]; _132 =3D *_127; - _133 =3D _131 + _132; - *__p_61 =3D _133; + *__p_61 =3D _132; __p_136 =3D __p_61 + 4; D.69731 =3D{v} {CLOBBER}; ivtmp.143_186 =3D ivtmp.143_71 + 16; - if (ivtmp.143_186 !=3D _60) + if (_158 !=3D ivtmp.143_186) goto ; [89.00%] which looks wrong at a first glance. Ah, it's OK because we have [local count: 2736164397]: # ivtmp.143_71 =3D PHI # PT =3D null { D.69770 } (escaped, escaped heap) _221 =3D (void *) ivtmp.143_71; # PT =3D nonlocal escaped null { D.69771 } (escaped, escaped heap) _124 =3D MEM[(int * *)_221 + 8B clique 11 base 0]; _115 =3D MEM[(const int &)_101 clique 11 base 0]; _162 =3D MEM[(const int &)_124 clique 11 base 0]; _140 =3D _115 + _162; MEM[(int *)_101 clique 11 base 1] =3D _140; # PT =3D { D.69772 } (escaped, escaped heap) __p_61 =3D _101 + 4; # PT =3D nonlocal escaped null { D.69771 } (escaped, escaped heap) _127 =3D _124 + 4; _131 =3D MEM[(const int &)__p_61 clique 11 base 0]; _132 =3D MEM[(const int &)_127 clique 11 base 0]; _133 =3D _131 + _132; MEM[(int *)__p_61 clique 11 base 1] =3D _133; # PT =3D { D.69772 } (escaped, escaped heap) __p_136 =3D __p_61 + 4; D.69731 =3D{v} {CLOBBER}; ivtmp.143_186 =3D ivtmp.143_71 + 16; if (ivtmp.143_186 !=3D _60) goto ; [89.00%] else goto ; [11.00%] so the load is from clique 11, base 0 while the store is to clique 11, base= 1 so they do not alias because of some __restrict marking. So the issue is likely=20 an invalid testcase or bogus annotation in libstdc++=