[Bug tree-optimization/99101] optimization bug with -ffinite-loops

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 25 11:34:04 GMT 2021


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

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
Oh, and the testcase does not require the abort () call but can do with a
regular exit and no unreachable blocks:

volatile int xx;
int main()
{
  int read_finish_ = 1;
  int jobs_ = 1;
  int at_eof_ = 0;
  while (1)
    {
      int num_job = jobs_;
      for (int i = 0; i < jobs_; i++)
        {
          if (at_eof_) continue;
          if (read_finish_)
            {
              at_eof_ = 1;
              __builtin_printf ("1\n");
              if (xx)
                return 1;
            }
        }
      jobs_ -= num_job;
    }
  return 0;
}

but it then of course shows the same post-dominance structure and thus
exhibits the same control dependences which do not agree with what
CD-DCE expects.


More information about the Gcc-bugs mailing list