From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A94533858C2C; Mon, 8 Nov 2021 19:00:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A94533858C2C From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103121] [12 Regression] Warnings in cp/optimize.c causing build failure Date: Mon, 08 Nov 2021 19:00:29 +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: build, diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status 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, 08 Nov 2021 19:00:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103121 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW --- Comment #5 from Martin Sebor --- I can reproduce the warning. It triggers for the store to *_23 in BB 13 be= low (dumped by debug_ranger()), where _23 is the result of the alloca() call in= BB 4 plus some offset. In BB 4, ranger sees two ranges for the alloca argument _4: [0, 0][2, +INF] on the edge 4->16, and [1, 1] on 4->12. 4->12 dead-end= s in BB 14 with a call to fancy_abort(), so the edge that leads to BB 13 is 4->1= 6.=20 But when we ask in BB 4 for _4's range we get VR_RANGE [1, 1]. That doesn't seem right. Without any guidance as to which edge I'm interested in I'd ex= pect to either get the union of the two ranges, [0, +INF]. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BB 4 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Imports: _1=20=20 Exports: _1=20=20 _1 unsigned int VARYING Equivalence set : [_1, _2] Relational : (_4 !=3D _1) [local count: 118111600]: _4 =3D _1 + 1; grp_name_37 =3D __builtin_alloca (_4); p_38 =3D _32->identifier.id.str; q_39 =3D _35->identifier.id.str; if (_1 !=3D 0) goto ; [89.00%] else goto ; [11.00%] grp_name_37 : char * [1B, +INF] 4->16 (T) _1 : unsigned int [1, +INF] 4->16 (T) _4 : unsigned int [0, 0][2, +INF] 4->12 (F) _1 : unsigned int [0, 0] 4->12 (F) _4 : unsigned int [1, 1] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BB 13 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Imports: diff_seen_24=20=20 Exports: diff_seen_24=20=20 diff_seen_24 bool VARYING idx_47 size_t [1, +INF] Relational : (_22 <=3D idx_47) [local count: 105119324]: _23 =3D grp_name_37 + idx_47; *_23 =3D 0; if (diff_seen_24 !=3D 0) goto ; [100.00%] else goto ; [0.00%] _23 : char * [1B, +INF] 13->14 (F) diff_seen_24 : bool [0, 0] 13->15 (T) diff_seen_24 : bool [1, 1]=