[Bug tree-optimization/42375] trunk hangs during diffutils configure

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Dec 15 13:35:00 GMT 2009



------- Comment #3 from rguenth at gcc dot gnu dot org  2009-12-15 13:35 -------
This is a bug in the test.  Early inter-procedural SRA avoids passing array by
reference in the recurse() function and instead passes the first element
which is the only one read.  Thus the function is optimized to
an endless loop.

  static int
  recurse (char *p)
  {
    char array[500];
    array[0] = 1;
    return *p + recurse (array);
  }

  int
  main (void)
  {
    return recurse ("\1");
  }

on i686 (or with -m32) this does not happen - Martin, any idea why?


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jamborm at gcc dot gnu dot
                   |                            |org
          Component|other                       |tree-optimization
   GCC host triplet|x86_64-unknown-linux-gnu    |
 GCC target triplet|                            |i?86-*-*
           Keywords|                            |missed-optimization


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



More information about the Gcc-bugs mailing list