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.

Reply via email to