public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43438]  New: possible wrong code bug
@ 2010-03-19  6:16 regehr at cs dot utah dot edu
  2010-03-19  6:51 ` [Bug c/43438] " sezeroz at gmail dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: regehr at cs dot utah dot edu @ 2010-03-19  6:16 UTC (permalink / raw)
  To: gcc-bugs

The -O0 result looks right.  This behavior observed on x86 using r157445 and
x64 using r157542.

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

static unsigned char g_2 = 1;
static int g_9;
static int *l_8 = &g_9;

static void func_12(int p_13)
{
  int * l_17 = &g_9;
  *l_17 &= 0 < p_13;
}

int main(void)
{
  unsigned char l_11 = 254;
  *l_8 |= g_2;
  l_11 |= *l_8;
  func_12(l_11);
  printf("%d\n", g_9);
  return 0;
} 
regehr@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r157445-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/compiler-install/gcc-r157445-install
--program-prefix=r157445- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100314 (experimental) (GCC)


-- 
           Summary: possible wrong code bug
           Product: gcc
           Version: unknown
            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=43438


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

end of thread, other threads:[~2010-04-20 13:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-19  6:16 [Bug c/43438] New: possible wrong code bug regehr at cs dot utah dot edu
2010-03-19  6:51 ` [Bug c/43438] " sezeroz at gmail dot com
2010-03-19  9:47 ` mikpe at it dot uu dot se
2010-03-19 11:02 ` [Bug c/43438] [4.3/4.4/4.5 Regression] " rguenth at gcc dot gnu dot org
2010-03-19 11:29 ` [Bug rtl-optimization/43438] " rguenth at gcc dot gnu dot org
2010-03-19 11:35 ` rguenth at gcc dot gnu dot org
2010-03-19 12:06 ` rguenth at gcc dot gnu dot org
2010-03-19 12:41 ` rguenth at gcc dot gnu dot org
2010-03-20 13:44 ` rguenth at gcc dot gnu dot org
2010-03-20 13:44 ` [Bug rtl-optimization/43438] [4.3/4.4 " rguenth at gcc dot gnu dot org
2010-03-22 15:06 ` jakub at gcc dot gnu dot org
2010-03-22 15:28 ` [Bug rtl-optimization/43438] [4.3 " jakub at gcc dot gnu dot org
2010-04-20 13:10 ` rguenth at gcc dot gnu dot org
2010-04-20 13:10 ` 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).