public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/47155] New: likely wrong code bug
@ 2011-01-03  3:01 regehr at cs dot utah.edu
  2011-01-03  9:13 ` [Bug tree-optimization/47155] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: regehr at cs dot utah.edu @ 2011-01-03  3:01 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: likely wrong code bug
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu
                CC: chenyang@cs.utah.edu


[regehr@gamow tmp438]$ current-gcc -O0 small.c -o small
[regehr@gamow tmp438]$ ./small
1
[regehr@gamow tmp438]$ current-gcc -O1 small.c -o small
[regehr@gamow tmp438]$ ./small
0
[regehr@gamow tmp438]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r168402-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r168402-install
--program-prefix=r168402- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20110102 (experimental) (GCC) 
[regehr@gamow tmp438]$ cat small.c


static unsigned int g_1;
static signed char g_2 = 0x81;

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

static unsigned char foo(unsigned char p1, unsigned char p2)
{
    return p1 * p2;
}

int main (void)
{
    int l_5[2];
    int i;
    for (i = 0; i < 2; i++)
        l_5[i] = 1;
    g_1 = g_2 <= foo(-6, l_5[0]);

    printf("%u\n", g_1);
    return 0;
}


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

end of thread, other threads:[~2011-01-03 21:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-03  3:01 [Bug c/47155] New: likely wrong code bug regehr at cs dot utah.edu
2011-01-03  9:13 ` [Bug tree-optimization/47155] " jakub at gcc dot gnu.org
2011-01-03  9:31 ` [Bug tree-optimization/47155] [4.6 Regression] ccp caused miscompilation jakub at gcc dot gnu.org
2011-01-03 21:01 ` jakub at gcc dot gnu.org
2011-01-03 21:12 ` jakub 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).