From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D2835385AC21; Wed, 10 Nov 2021 04:38:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2835385AC21 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103161] [12 Regression] Better ranges cause builtin-sprintf-warn-16.c failure Date: Wed, 10 Nov 2021 04:38:10 +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: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: msebor at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: see_also bug_status assigned_to 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: Wed, 10 Nov 2021 04:38:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103161 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D102831 Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot g= nu.org --- Comment #3 from Martin Sebor --- Confirmed. It's a failure in what looks like a paranoia test that tries to verify that the sprintf pass isn't making overly aggressive assumptions abo= ut the width field. The sprintf pass calls get_range_expr() to determine the range. It runs as part of the strlen pass which still uses EVRP for ranges= .=20 It's strange that the range is different for some targets than others (the = IL is otherwise identical). Since the code is using the same EVRP analyzer as before I'd expect the GIMPLE statement passed to get_range_expr() to be ign= ored and the range to be "global" for the whole function body. I haven't looked into this in enough detail to understand what's different. As of now this = is just as puzzling to me as the false positive reported in pr102831. I'd exp= ect converting the strlen pass to use ranger to fix this. I plan to work on it sometime soon.=