[Bug tree-optimization/54985] [4.7/4.8 Regression] dom optimization erroneous remove conditional goto.

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Oct 19 11:20:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54985

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.6.3
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2012-10-19
          Component|middle-end                  |tree-optimization
     Ever Confirmed|0                           |1
            Summary|Dom optimization erroneous  |[4.7/4.8 Regression] dom
                   |remove conditional goto.    |optimization erroneous
                   |                            |remove conditional goto.
   Target Milestone|---                         |4.7.3
      Known to fail|                            |4.7.2, 4.8.0

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-19 11:19:38 UTC ---
Confirmed.  Single-file testcase, fails with 4.7 and 4.8.

typedef struct st {
    int a;
} ST;

int __attribute__((noinline,noclone))
foo(ST *s, int c)
{
  int first = 1;
  int count = c;
  ST *item = s;
  int a = s->a;
  int x;

  while (count--)
    {
      x = item->a;
      if (first)
        first = 0;
      else if (x >= a)
        return 1;
      a = x;
      item++;
    }
  return 0;
}

extern void abort (void);

int main ()
{
  ST _1[2] = {{2}, {1}};
  if (foo(_1, 2) != 0)
    abort ();
  return 0;
}



More information about the Gcc-bugs mailing list