public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/58564] New: possible wrong code bug at -O0
@ 2013-09-28 18:10 regehr at cs dot utah.edu
  2013-09-28 21:05 ` [Bug c/58564] " mikpelinux at gmail dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: regehr at cs dot utah.edu @ 2013-09-28 18:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58564
           Summary: possible wrong code bug at -O0
           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@john-home ~ $ clang -O0 -w small.c ; ./a.out
0
regehr@john-home ~ $ gcc-4.4 -O0 -w small.c ; ./a.out
0
regehr@john-home ~ $ gcc-4.6 -O0 -w small.c ; ./a.out
0
regehr@john-home ~ $ gcc-4.7 -O0 -w small.c ; ./a.out
1
regehr@john-home ~ $ gcc -O0 -w small.c ; ./a.out
1
regehr@john-home ~ $ cat small.c 
int printf(const char *, ...);
int a, b;
short *c;
short **d = &c;
int main() {
  b = (0, 0 > ((&c == d) & (1 && a ^ 1))) | 0U;
  printf("%d\n", b);
  return 0;
}
regehr@john-home ~ $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r203005-install/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/regehr/z/compiler-source/gcc/configure
--prefix=/home/regehr/z/compiler-install/gcc-r203005-install
--enable-languages=c,c++ --disable-multilib
Thread model: posix
gcc version 4.9.0 20130928 (experimental) (GCC)


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

end of thread, other threads:[~2014-05-07 16:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-28 18:10 [Bug c/58564] New: possible wrong code bug at -O0 regehr at cs dot utah.edu
2013-09-28 21:05 ` [Bug c/58564] " mikpelinux at gmail dot com
2013-09-28 21:25 ` ktietz at gcc dot gnu.org
2013-09-29  3:03 ` regehr at cs dot utah.edu
2013-09-29  9:23 ` mikpelinux at gmail dot com
2013-09-30  6:53 ` ktietz at gcc dot gnu.org
2013-09-30  8:43 ` [Bug middle-end/58564] [4.7/4.8/4.9 Regression] " jakub at gcc dot gnu.org
2013-09-30  9:41 ` jakub at gcc dot gnu.org
2013-09-30  9:56 ` jakub at gcc dot gnu.org
2013-09-30 20:15 ` jakub at gcc dot gnu.org
2013-09-30 20:16 ` jakub at gcc dot gnu.org
2013-09-30 20:17 ` jakub at gcc dot gnu.org
2013-09-30 20:18 ` [Bug middle-end/58564] [4.7 " jakub at gcc dot gnu.org
2014-05-07 16:06 ` jakub at gcc dot gnu.org
2014-05-07 16:20 ` 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).