From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1195839450EC; Mon, 25 Jan 2021 11:29:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1195839450EC From: "amker at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97627] [9/10/11 Regression] loop end condition missing - endless loop with -fPIC Date: Mon, 25 Jan 2021 11:29:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: amker 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: 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, 25 Jan 2021 11:29:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97627 --- Comment #11 from bin cheng --- (In reply to bin cheng from comment #10) > hmm, > For below basic block: > 128 ;; basic block 4, loop depth 2, maybe hot > 129 ;; prev block 3, next block 9, flags: (NEW, VISITED) > 130 ;; pred: 3 (FALLTHRU,EXECUTABLE) > 131 ;; 7 (FALLTHRU,DFS_BACK,EXECUTABLE) > 132 # RANGE [0, 2147483647] NONZERO 2147483647 > 133 # c_5 =3D PHI <0(3), c_17(7)> > 134 # .MEM_8 =3D PHI <.MEM_7(3), .MEM_9(7)> > 135 if (_2 < c_5) > 136 goto ; [INV] > 137 else > 138 goto ; [INV] > 139 ;; succ: 8 (TRUE_VALUE,EXECUTABLE) > 140 ;; 9 (FALSE_VALUE,EXECUTABLE) >=20 > Code in : > 4276=20 > 4277 basic_block *body =3D get_loop_body (loop); > 4278 exits =3D get_loop_exit_edges (loop, body); > 4279 likely_exit =3D single_likely_exit (loop, exits); > 4280 FOR_EACH_VEC_ELT (exits, i, ex) > 4281 { > 4282 if (ex =3D=3D likely_exit) > 4283 { > 4284 gimple *stmt =3D last_stmt (ex->src); > 4285 if (stmt !=3D NULL) > 4286 { >=20 > gets three exit edges, one of which is bb1>, as a result, 0 niter= is > computed for this exit in function number_of_iterations_exit_assumptions.= =20 > This seems strange, is it a fake edge added for some reason? >=20 > Thanks Right, it's added by connect_infinite_loops_to_exit.=