public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/58246] New: wrong code at -O1 and above (affecting 4.6, 4.7, 4.8, and trunk)
@ 2013-08-27  4:36 su at cs dot ucdavis.edu
  2013-08-27  7:15 ` [Bug tree-optimization/58246] [4.7/4.8/4.9 Regression] wrong code at -O1 and above jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: su at cs dot ucdavis.edu @ 2013-08-27  4:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58246
           Summary: wrong code at -O1 and above (affecting 4.6, 4.7, 4.8,
                    and trunk)
           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 (as well as gcc 4.6, 4.7, and 4.8) produces wrong code
for the following testcase on x86_64-linux when compiled at -O1 and above in
both 32-bit and 64-bit modes. 


$ gcc-trunk -v
gcc version 4.9.0 20130826 (experimental) [trunk revision 201986] (GCC) 
$ gcc-trunk -O0 small.c
$ a.out
1
$ gcc-trunk -O1 small.c
$ a.out
0
$ gcc-4.8 -O1 small.c
$ a.out
0
$ gcc-4.7 -O1 small.c
$ a.out
0
$ gcc-4.6 -O1 small.c
$ a.out
0
$ 


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

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

int a, b; 

int main ()
{
  int t[2] = {1,1};

  for (a = 0; a < 2; a++)
    {
      b ^= t[a];
      t[a] = t[1] = 0;
    }

  printf ("%d\n", b);

  return 0;
}


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

end of thread, other threads:[~2014-05-07  8:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-27  4:36 [Bug tree-optimization/58246] New: wrong code at -O1 and above (affecting 4.6, 4.7, 4.8, and trunk) su at cs dot ucdavis.edu
2013-08-27  7:15 ` [Bug tree-optimization/58246] [4.7/4.8/4.9 Regression] wrong code at -O1 and above jakub at gcc dot gnu.org
2013-08-27  7:23 ` jakub at gcc dot gnu.org
2013-08-29 10:41 ` rguenth at gcc dot gnu.org
2013-08-29 10:58 ` rguenth at gcc dot gnu.org
2013-08-29 13:04 ` rguenth at gcc dot gnu.org
2013-08-30  7:54 ` [Bug tree-optimization/58246] [4.7/4.8 " rguenth at gcc dot gnu.org
2013-09-03 12:18 ` rguenth at gcc dot gnu.org
2014-05-07  7:59 ` [Bug tree-optimization/58246] [4.7 " rguenth at gcc dot gnu.org
2014-05-07  8:00 ` 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).