From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 61E1B3858401; Mon, 3 Oct 2022 15:46:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61E1B3858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664811966; bh=E/lOkA5XoCMknLwXZnvBd9v7TtDykQIAxcu3n5XtJc8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DdTJTWjRGPgVLEK6Tjky+G/ZFTHThz93pO7o5C4YZ/mP1dAQTVQTT1S1cYO4p0RHP 8qCgLtiAYf8jLnXubdS3CWrQQKQ0LOwmq48/BmJ7t1YDITtZ/ohyiSXAsYaDjxafXT GBWPS6/CFCWdfPihyu8B57MUYwCPrFwns3ZPQxgM= From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107114] [13 Regression] Failure to discover range results in bogus warning Date: Mon, 03 Oct 2022 15:46:05 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107114 --- Comment #1 from Andrew Macleod --- Looks like something in the change is causing the loop analysis to not be a= ble to count the iterations. > Analyzing # of iterations of loop 1 > exit condition [1, + , 1] !=3D 0 > bounds on difference of bases: -1 ... -1 > result: > # of iterations 65535, bounded by 65535 109,110d68 < Loops range found for a_lsm.14_26: [irange] short int [1, 9] NONZERO 0= xf and calculated range :[irange] short int VARYING < Global Exported: a_lsm.14_26 =3D [irange] short int [1, 9] NONZERO 0xf 112,114c70,72 < Loops range found for c_lsm.16_29: [irange] int [1, 2115902953] NONZERO 0x7fffffff and calculated range :[irange] int [-1618507910, +INF] < Global Exported: c_lsm.16_29 =3D [irange] int [1, 2115902953] NONZERO 0x7fffffff < Folding PHI node: a_lsm.14_26 =3D PHI <1(2), _11(12)> before this change, loop analysis decided the range of _26 as a_lsm.14_26: [irange] short int [1, 9] NONZERO 0xf a afterwards, it doesn't even seem to see the loop. IN fact, before LCSSA creates a whole bunch of new blocks too. < ;; Created LCSSA PHI: a_lsm.14_15 =3D PHI < ;; Created LCSSA PHI: a_lsm_flag.15_16 =3D PHI < ;; Created LCSSA PHI: d_47 =3D PHI <=20 < Updating SSA: < Registering new PHI nodes in block #13 < Updating SSA information for statement if (a_lsm.14_26 !=3D 0) < Registering new PHI nodes in block #6 < Registering new PHI nodes in block #12 < Updating SSA information for statement a.9_9 =3D (unsigned short) a_lsm.1= 4_26; < Registering new PHI nodes in block #16 < Registering new PHI nodes in block #7 < Registering new PHI nodes in block #8 < Updating SSA information for statement if (d_13 !=3D 0B) < Registering new PHI nodes in block #9 < Updating SSA information for statement if (a_lsm_flag.15_28 !=3D 0) < Registering new PHI nodes in block #10 < Updating SSA information for statement a =3D a_lsm.14_26; < Registering new PHI nodes in block #11 < Registering new PHI nodes in block #19 < Registering new PHI nodes in block #15=