public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/61576] New: wrong code at -O3 on x86_64-linux-gnu
@ 2014-06-20 23:07 su at cs dot ucdavis.edu
  2014-06-23  7:59 ` [Bug tree-optimization/61576] [4.10 Regression] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-06-20 23:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61576
           Summary: wrong code at -O3 on x86_64-linux-gnu
           Product: gcc
           Version: 4.10.0
            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 miscompiles the following testcase on x86_64-linux at -O3
in both 32-bit and 64-bit modes.  

This is a regression from 4.9.x.  

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 4.10.0 20140620 (experimental) [trunk revision 211848] (GCC) 
$ 
$ gcc-trunk -O2 small.c; a.out
0
$ gcc-4.9.0 -O3 small.c; a.out
0
$ 
$ gcc-trunk -O3 small.c; a.out
1
$ 

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

int printf (const char *, ...);

volatile int a, b;
int c, d, e, f;

static int
fn1 ()
{
  if (b)
    {
      d++;
      e = c || f;
    }
  return 0;
}

int
main ()
{
  for (; a < 1; a++)
    {
      fn1 ();
      continue;
    }
  printf ("%d\n", d);
  return 0;
}


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

end of thread, other threads:[~2014-11-19 13:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-20 23:07 [Bug tree-optimization/61576] New: wrong code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
2014-06-23  7:59 ` [Bug tree-optimization/61576] [4.10 Regression] " jakub at gcc dot gnu.org
2014-06-23 10:41 ` rguenth at gcc dot gnu.org
2014-06-23 10:44 ` rguenth at gcc dot gnu.org
2014-06-23 14:13 ` ysrumyan at gmail dot com
2014-06-26  8:00 ` izamyatin at gmail dot com
2014-07-08  7:52 ` kyukhin at gcc dot gnu.org
2014-11-19 13:50 ` [Bug tree-optimization/61576] [5 " 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).