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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly more valid testcase:
struct A { void foo (); A (); A (const A &); A & operator++ (); int a; };

void
bar ()
{
  A a;
  #pragma omp for
  for (auto b = a; b != a.foo; ++b)
    ;
}

I believe the actual problem is that r230364 added a cond = cp_fully_fold
(cond);
before the handling and cp_fully_fold doesn't handle well invalid code, it is
assumed it is only called on code that has been previously validated.
The reason it only ICEs since r265930 is that before != was not a valid
condition comparison, and with < instead during folding we don't go into the
problematic paths that ICE.
I'll need to find out what breaks if that cond = cp_fully_fold (cond); is
either removed or moved after the verification.

Reply via email to