public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53160] New: likely wrong code bug
@ 2012-04-29 18:49 regehr at cs dot utah.edu
  2012-04-29 20:01 ` [Bug rtl-optimization/53160] [4.8 Regression] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: regehr at cs dot utah.edu @ 2012-04-29 18:49 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53160
           Summary: likely wrong code bug
    Classification: Unclassified
           Product: gcc
           Version: 4.8.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@regehr-System-Product-Name:~$ current-gcc -O1 small.c ; ./a.out 
0
regehr@regehr-System-Product-Name:~$ current-gcc -O2 small.c ; ./a.out 
1466236928
regehr@regehr-System-Product-Name:~$ cat small.c 
int printf (const char *, ...);
int a, c = 1, d, e, g;
volatile int b;
volatile char f;
long h;
short i;
void
fn1 (p1)
{
    e = 0;
    for (; e; ++e)
        ;
}
int
main ()
{
    fn1 (g && b);
    d = 0;
    for (; d >= 0; d--)
    {
        short j = f;
        int k = 0;
        i = j ? j : j << k;
    }
    h = c == 0 ? 0 : i;
    a = h;
    printf ("%d\n", a);
    return 0;
}
regehr@regehr-System-Product-Name:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r186920-install/libexec/gcc/x86_64-unknown-linux-gnu/4.8.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-r186920-install
--program-prefix=r186920- --enable-languages=c,c++
Thread model: posix
gcc version 4.8.0 20120427 (experimental) (GCC)


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

end of thread, other threads:[~2012-05-02  7:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-29 18:49 [Bug c/53160] New: likely wrong code bug regehr at cs dot utah.edu
2012-04-29 20:01 ` [Bug rtl-optimization/53160] [4.8 Regression] " pinskia at gcc dot gnu.org
2012-04-30  7:18 ` [Bug rtl-optimization/53160] [4.7/4.8 " jakub at gcc dot gnu.org
2012-04-30  9:46 ` jakub at gcc dot gnu.org
2012-05-02  7:14 ` jakub at gcc dot gnu.org
2012-05-02  7:20 ` jakub at gcc dot gnu.org
2012-05-02  7:22 ` 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).