public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/58227] New: wrong code (hangs) at -O3 on x86_64-linux-gnu
@ 2013-08-23  7:34 su at cs dot ucdavis.edu
  2013-08-23  7:43 ` [Bug tree-optimization/58227] " mpolacek at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: su at cs dot ucdavis.edu @ 2013-08-23  7:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58227
           Summary: wrong code (hangs) at -O3 on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The current gcc trunk produces wrong code (that hangs) for the following
testcase on x86_64-linux when compiled at -O3 in both 32-bit and 64-bit modes. 

This is a regression from 4.8.x.

It might be related to 58143, but 58143 also fails for 4.8. 


$ gcc-trunk -v
gcc version 4.9.0 20130822 (experimental) [trunk revision 201915] (GCC) 
$ gcc-4.8 -O3 reduced.c
$ a.out
$ gcc-trunk -O2 reduced.c
$ a.out
$ gcc-trunk -O3 reduced.c
$ a.out
^C
$ 


------------------------------------------

int a, b, d, e, f, *g, h, i;
volatile int c;

char foo (unsigned char p)
{
  return p + 1;
}

int bar () 
{
  for (h = 0; h < 3; h = foo (h))
    {
      c;
      for (f = 0; f < 1; f++)
    {
      i = a && 0 < -2147483647 - h ? 0 : 1;
      if (e)
        for (; d;)
          b = 0;
      else
        g = 0;
    }
    }
  return 0;
}

int main ()
{
  bar ();
  return 0;
}


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-15  8:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-23  7:34 [Bug tree-optimization/58227] New: wrong code (hangs) at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
2013-08-23  7:43 ` [Bug tree-optimization/58227] " mpolacek at gcc dot gnu.org
2013-08-23  7:49 ` su at cs dot ucdavis.edu
2013-08-23  7:58 ` mpolacek at gcc dot gnu.org
2013-08-23  8:03 ` [Bug tree-optimization/58227] [4.9 Regression] " mpolacek at gcc dot gnu.org
2013-08-27 12:00 ` bernd.edlinger at hotmail dot de
2013-10-15  8:15 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).