public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/58626] New: possible array wrong code bug
@ 2013-10-05  5:35 regehr at cs dot utah.edu
  2013-10-05 11:50 ` [Bug c/58626] " mikpelinux at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: regehr at cs dot utah.edu @ 2013-10-05  5:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58626
           Summary: possible array wrong code bug
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: regehr at cs dot utah.edu

[regehr@imp r106]$ gcc -O2 small.c ; ./a.out 
1
[regehr@imp r106]$ gcc -O3 small.c ; ./a.out 
0
[regehr@imp r106]$ cat small.c
int printf(const char *, ...);

int a[8][6] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
int b;

int main(void) 
{
  for (b = 0; b <= 1; b++) {
    a[1][3] = 0;
    int c;
    for (c = 0; c <= 1; c++) {
      a[c + 1][b] = a[c + 2][b];
    }
  }
  printf("%d\n", a[1][1]);
  return 0;
}
[regehr@imp r106]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/mnt/local/randomtest/compiler-install/gcc-r203223-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /users/regehr/z/compiler-source/gcc/configure
--prefix=/users/regehr/z/compiler-install/gcc-r203223-install
--enable-languages=c,c++ --enable-multilib
Thread model: posix
gcc version 4.9.0 20131005 (experimental) (GCC)


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

end of thread, other threads:[~2013-10-25 12:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-05  5:35 [Bug c/58626] New: possible array wrong code bug regehr at cs dot utah.edu
2013-10-05 11:50 ` [Bug c/58626] " mikpelinux at gmail dot com
2013-10-07  9:03 ` mpolacek at gcc dot gnu.org
2013-10-10 11:50 ` [Bug c/58626] [4.9 Regression] " rguenth at gcc dot gnu.org
2013-10-11 11:36 ` rguenth at gcc dot gnu.org
2013-10-16  9:25 ` [Bug tree-optimization/58626] " mpolacek at gcc dot gnu.org
2013-10-25 11:51 ` rguenth at gcc dot gnu.org
2013-10-25 12:31 ` 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).