From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BE7853858405; Mon, 8 Nov 2021 21:48:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE7853858405 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 21:48:23 +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: 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 21:48:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103121 --- Comment #12 from Martin Sebor --- Okay, here's my question: when I call range_of_expr (vr, _4, stmt) with stmt being 'grp_name_37 =3D __builtin_alloca (_4)' in BB 4, should I not expect = the result to be either VR_VARYING or [0, +INF]? What I think is wrong is that the result is VR_RANGE [1, 1]. That is true = in BB 12 but I did not tell ranger that I'm asking about _4 for BB 12 (i.e., t= he 4->12 edge). I just asked it about _4 in BB 4. The result for the BB 12 query actually happens to be cached by the pointer_query class and retrieved for subsequent queries about pointers use= d in other BB's, but those queries are all independent of the path from BB 4 to = the BB they're being made for. When I disable the caching then the first query about _4 in BB 4 (made on behalf of BB 12) gives me [1, 1], and the query f= or _4 in BB 4 (made on behalf of BB 13) gives me VR_VARYING and the warning disappears. The latter is as expected but I don't expect to get a different range for the same SSA_NAME in the same basic block unless I specify which outgoing edge I'm interested in. So what am I missing?=