public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52406] New: likely wrong code bug
@ 2012-02-27 18:15 regehr at cs dot utah.edu
  2012-02-27 22:54 ` [Bug tree-optimization/52406] [4.7 Regression] " jakub at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: regehr at cs dot utah.edu @ 2012-02-27 18:15 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52406
           Summary: likely wrong code bug
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu


regehr@john-home:~/z/reduce/1$ current-gcc -O2 small.c ; ./a.out 
1
regehr@john-home:~/z/reduce/1$ current-gcc -O3 small.c ; ./a.out 
0
regehr@john-home:~/z/reduce/1$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r184581-install/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r184581-install
--program-prefix=r184581- --enable-languages=c,c++
Thread model: posix
gcc version 4.7.0 20120226 (experimental) (GCC) 
regehr@john-home:~/z/reduce/1$ cat small.c
int printf (const char *, ...);

struct
{
  int f1;
} a[2];

int *b, *const k = &a[1].f1;

static int **c = &b;

int e, f, d;

int main ()
{
  int **l = &b;
  *l = k;
  for ( ; d <= 0; d++ )
    {
      int *j = &e;
      **c = 1;
      *l = k;
      *k ^= 0;
      f = **l;
      *j = f;
    }
  printf ( "%d\n", e );
  return 0;
}


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

end of thread, other threads:[~2012-04-03 14:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27 18:15 [Bug c/52406] New: likely wrong code bug regehr at cs dot utah.edu
2012-02-27 22:54 ` [Bug tree-optimization/52406] [4.7 Regression] " jakub at gcc dot gnu.org
2012-02-28  9:59 ` jakub at gcc dot gnu.org
2012-02-28 10:21 ` jakub at gcc dot gnu.org
2012-02-28 10:44 ` rguenth at gcc dot gnu.org
2012-02-28 11:32 ` rguenth at gcc dot gnu.org
2012-02-28 14:37 ` rguenth at gcc dot gnu.org
2012-03-01 11:42 ` rguenth at gcc dot gnu.org
2012-03-02 15:00 ` [Bug tree-optimization/52406] [4.7/4.8 " rguenth at gcc dot gnu.org
2012-03-02 15:05 ` [Bug tree-optimization/52406] [4.7 " rguenth at gcc dot gnu.org
2012-03-14  9:35 ` izamyatin at gmail dot com
2012-04-03 14:33 ` rguenth at gcc dot gnu.org
2012-04-03 14:34 ` 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).