public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/104196] New: wrong code at -O2 and above on x86_64-linux-gnu
@ 2022-01-24  0:01 cnsun at uwaterloo dot ca
  2022-01-24  0:17 ` [Bug middle-end/104196] " jakub at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: cnsun at uwaterloo dot ca @ 2022-01-24  0:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104196

            Bug ID: 104196
           Summary: wrong code at -O2 and above on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk small.c -w -O2 ; ./a.out
g_1600=6
$ gcc-trunk small.c -w -O3 ; ./a.out
g_1600=6
$ gcc-trunk small.c -w -O1 ; ./a.out
$ gcc-trunk small.c -w -O0 ; ./a.out
$ cat small.c
int a = 6;
int main() {
  int b;
  for (;;) {
    b = a < 0 && 0 < -2147483647 - a ? 0 : a;
    if (b != 0x8C65C01D) {
      if (a < 6)
        printf("g_1600=%llu\n", (long long)a);
      goto c;
    }
  }
c:;
}
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.8MPqhHrPX1-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.1 20220123 (experimental) [master -g9718bc4b0] (GCC) 
$

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

end of thread, other threads:[~2022-01-27 10:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-24  0:01 [Bug c/104196] New: wrong code at -O2 and above on x86_64-linux-gnu cnsun at uwaterloo dot ca
2022-01-24  0:17 ` [Bug middle-end/104196] " jakub at gcc dot gnu.org
2022-01-24  0:17 ` [Bug tree-optimization/104196] [12 Regression] " jakub at gcc dot gnu.org
2022-01-24  0:37 ` pinskia at gcc dot gnu.org
2022-01-24  1:52 ` pinskia at gcc dot gnu.org
2022-01-24  2:00 ` pinskia at gcc dot gnu.org
2022-01-24  2:17 ` pinskia at gcc dot gnu.org
2022-01-24  2:19 ` pinskia at gcc dot gnu.org
2022-01-24  5:58 ` belyshev at depni dot sinp.msu.ru
2022-01-24 16:12 ` jakub at gcc dot gnu.org
2022-01-26 10:52 ` jakub at gcc dot gnu.org
2022-01-26 14:07 ` jakub at gcc dot gnu.org
2022-01-27  9:47 ` cvs-commit at gcc dot gnu.org
2022-01-27 10: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).