From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 27593387742A; Mon, 14 Jun 2021 13:02:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27593387742A From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100934] [9/10/11/12 Regression] wrong code at -O3 during unrolling since r9-6299 Date: Mon, 14 Jun 2021 13:02:43 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 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 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: Mon, 14 Jun 2021 13:02:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100934 --- Comment #10 from rguenther at suse dot de --- On Mon, 14 Jun 2021, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100934 >=20 > --- Comment #9 from Jakub Jelinek --- > (In reply to Richard Biener from comment #8) > > --- a/gcc/tree-ssa-threadupdate.c > > +++ b/gcc/tree-ssa-threadupdate.c > > @@ -2379,12 +2379,15 @@ jump_thread_path_registry::duplicate_thread_path > > (edge entry, > > missuses of the functions. I.e. if you ask to copy something wei= rd, > > it will work, but the state of structures probably will not be > > correct. */ > > + bool loop_header_duplicated =3D false; > > for (i =3D 0; i < n_region; i++) > > { > > /* We do not handle subloops, i.e. all the blocks must belong to= the > > same loop. */ > > if (region[i]->loop_father !=3D loop) > > return false; > > + if (region[i]->loop_father =3D=3D loop) > > + loop_header_duplicated =3D true; >=20 > The if right above this returns false if loop_father is not loop, so > wouldn't be loop_header_duplicated =3D=3D true whenever n_region !=3D 0 (= or always)? whoops yes, this should be region[i] =3D=3D loop->header but as said the issue is elsewhere (patch in testing) and the issue in=20 duplicate_thread_path does not have a testcase yet.=