public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/42952]  New: possible integer wrong code bug
@ 2010-02-04  5:45 regehr at cs dot utah dot edu
  2010-02-04  7:38 ` [Bug middle-end/42952] [4.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: regehr at cs dot utah dot edu @ 2010-02-04  5:45 UTC (permalink / raw)
  To: gcc-bugs

The program below looks to me like it should print "0".

regehr@john-home:~$ current-gcc -O small.c -o small
regehr@john-home:~$ ./small
1
regehr@john-home:~$ cat small.c
extern int printf (__const char *__restrict __format, ...);

static int g_16[1];

static int *g_135 = &g_16[0];
static int *l_15 = &g_16[0];

static void foo (void)
{
  g_16[0] = 1;
  *g_135 = 0;
  *g_135 = *l_15;
  printf("%d\n", g_16[0]);
}

int main(void)
{
   foo();
   return 0;
} 
regehr@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r156486-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r156486-install --program-prefix=r156486-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100204 (experimental) (GCC)


-- 
           Summary: possible integer wrong code bug
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2010-02-04 16:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-04  5:45 [Bug c/42952] New: possible integer wrong code bug regehr at cs dot utah dot edu
2010-02-04  7:38 ` [Bug middle-end/42952] [4.5 Regression] " pinskia at gcc dot gnu dot org
2010-02-04 10:03 ` [Bug rtl-optimization/42952] " rguenth at gcc dot gnu dot org
2010-02-04 10:11 ` rguenth at gcc dot gnu dot org
2010-02-04 10:34 ` rguenth at gcc dot gnu dot org
2010-02-04 10:36 ` rguenth at gcc dot gnu dot org
2010-02-04 14:57 ` zadeck at naturalbridge dot com
2010-02-04 15:04 ` matz at gcc dot gnu dot org
2010-02-04 15:22 ` [Bug rtl-optimization/42952] [4.3/4.4/4.5 " rguenth at gcc dot gnu dot org
2010-02-04 16:14 ` rguenth at gcc dot gnu dot org
2010-02-04 16:18 ` rguenth at gcc dot gnu dot org
2010-02-04 16:22 ` rguenth at gcc dot gnu dot org
2010-02-04 16:22 ` rguenth at gcc dot gnu dot 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).