public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/109138] New: wrong code at -O1 and above on x86_64-linux-gnu
@ 2023-03-15  5:20 zhendong.su at inf dot ethz.ch
  2023-03-15  6:07 ` [Bug tree-optimization/109138] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2023-03-15  5:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109138
           Summary: wrong code at -O1 and above on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

This appears to be long latent, affecting at least 5.* and later. 

Compiler Explorer: https://godbolt.org/z/9rb354E51

[592] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/13.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
--with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.1 20230315 (experimental) [master r13-6679-gfd42a8fa4b7] (GCC) 
[593] % 
[593] % gcctk -O0 small.c; ./a.out
[594] % 
[594] % gcctk -O1 small.c
[595] % timeout -s 9 5 ./a.out
Killed
[596] % 
[596] % cat small.c
unsigned a = -1;
int main() {
  int b = 0;
  for (; b < 2; b++) {
  L:;
    int d;
    while (a <= 0)
      if (*&d)
        break;
    d = 1;
    a++;
  }
  return 0;
}

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

end of thread, other threads:[~2023-03-15 10:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15  5:20 [Bug tree-optimization/109138] New: wrong code at -O1 and above on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2023-03-15  6:07 ` [Bug tree-optimization/109138] " pinskia at gcc dot gnu.org
2023-03-15  8:40 ` rguenth at gcc dot gnu.org
2023-03-15  8:51 ` pinskia at gcc dot gnu.org
2023-03-15  9:26 ` [Bug tree-optimization/109138] [10/11/12/13 Regression] " jakub at gcc dot gnu.org
2023-03-15  9:39 ` jakub at gcc dot gnu.org
2023-03-15 10:54 ` zhendong.su at inf dot ethz.ch

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).