From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CCAEE3858409; Fri, 14 Apr 2023 21:23:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCAEE3858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681507439; bh=xJP7veWYSbZu7u8x+w1GMjC+WM/VAl6tHD8rrpODm6A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=r6yYCluml6N5cHHr73VmtlyfEycBXHrcIeB0fhRRu7x/WSp2nwWrbvv9ICJfFuEQC 2xVKIkglcl5uJADRnNzd4UjKwXgnzlJmmooy44gFOddvjFz7eXBPXhXHPFMxv/qgD6 uEysHeTOkcD9TmoxwTK/RkfVBF7pHfbRjggIKrqE= From: "StevenSun2021 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/109027] [13 Regression] ICE: SIGSEGV (infinite recursion in ana::constraint_manager::eval_condition / ana::constraint_manager::impossible_derived_conditions_p) with -fanalyzer since r13-6101-g4d3b7be281e73ecd Date: Fri, 14 Apr 2023 21:23:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: StevenSun2021 at hotmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created 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=3D109027 Steven Sun changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |StevenSun2021 at hotmail d= ot com --- Comment #2 from Steven Sun --- Created attachment 54862 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54862&action=3Dedit new test case New logic introduced in r13-6101-g4d3b7be281e73ecd causes infinite recursio= ns. Specifically, `impossible_derived_conditions_p` will fail to escape this recursion. In this situation, for some `a`, `b`, we have `a+4` and `b-4` exist in different equivalent classes (of the `m_equiv_classes`). Then we try to compare `a =3D=3D b-4`, `impossible_derived_conditions_p` th= en bring us to to check `a =3D=3D b-4`, we'll look at `b =3D=3D a+4`, since `a+4` is already in some equivalent class, we must know something abo= ut it. to check `b =3D=3D a+4`, we'll look at `a =3D=3D b-4`, since `b-4` is already in some equivalent class, we must know something abo= ut it. Then, it continues infinitely. We should bail this out. Also, it seems that= the analyzer cannot recognize some template patterns, failing to enter any exit paths. This code path executes very rarely. ------------------ While trying to simplify the original test case, I discovered my new test c= ase is another infinite recursion but in a different code path.=