public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "StevenSun2021 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-109027-4-FVxAzSEDtQ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109027-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109027

Steven Sun <StevenSun2021 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |StevenSun2021 at hotmail dot com

--- Comment #2 from Steven Sun <StevenSun2021 at hotmail dot com> ---
Created attachment 54862
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54862&action=edit
new test case

New logic introduced in r13-6101-g4d3b7be281e73ecd causes infinite recursions.
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 == b-4`, `impossible_derived_conditions_p` then bring
us to

to check            `a == b-4`,
we'll look at       `b == a+4`,
since `a+4` is already in some equivalent class, we must know something about
it.


to check          `b == a+4`,
we'll look at     `a == b-4`,
since `b-4` is already in some equivalent class, we must know something about
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 case
is another infinite recursion but in a different code path.

  parent reply	other threads:[~2023-04-14 21:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-05 10:25 [Bug analyzer/109027] New: [13 Regression] ICE: SIGSEGV (infinite recursion in ana::constraint_manager::eval_condition / ana::constraint_manager::impossible_derived_conditions_p) with -fanalyzer zsojka at seznam dot cz
2023-03-06  8:37 ` [Bug analyzer/109027] " rguenth at gcc dot gnu.org
2023-03-07 14:56 ` [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 marxin at gcc dot gnu.org
2023-04-14  4:43 ` law at gcc dot gnu.org
2023-04-14 21:23 ` StevenSun2021 at hotmail dot com [this message]
2023-04-15  6:32 ` StevenSun2021 at hotmail dot com
2023-04-26  6:57 ` [Bug analyzer/109027] [13/14 " rguenth at gcc dot gnu.org
2023-07-27  9:25 ` rguenth at gcc dot gnu.org
2023-08-23 20:46 ` dmalcolm at gcc dot gnu.org
2024-05-21  9:14 ` [Bug analyzer/109027] [13/14/15 " jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109027-4-FVxAzSEDtQ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).