public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115388] New: wrong code at -O3 on x86_64-linux-gnu
@ 2024-06-07 19:16 zhendong.su at inf dot ethz.ch
  2024-06-07 23:50 ` [Bug middle-end/115388] [15 Regression] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2024-06-07 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115388
           Summary: wrong code at -O3 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 a recent regression as it doesn't reproduce with 14.1 and
earlier.

Compiler Explorer: https://godbolt.org/z/dzbaj98PM

[515] % 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/15.0.0/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
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240607 (experimental) (GCC) 
[516] % 
[516] % gcctk -O2 small.c; ./a.out
[517] % gcctk -O3 small.c
[518] % ./a.out
Aborted
[519] % cat small.c
int printf(const char *, ...);
int a[10], b, c, d[0], h, i, j, k, l;
char e = -1, g;
volatile int f;
static void n() {
  while (e >= 0)
    while (1)
      ;
  for (b = 2; b >= 0; b--) {
    for (k = 0; k < 4; k++) {
      if (e || i)
        continue;
      for (h = 0; h < 2; h++)
        f;
    }
    for (l = 2; l >= 0; l--)
      g = 0;
    for (; g < 1; g++)
      if (c)
        d[l] = 1;
    a[9] = 0;
    a[b] = 1;
    while (j)
      printf("\n");
  }
}
int main() {
  n();
  if (a[1] != 1)
    __builtin_abort();
  return 0;
}

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

end of thread, other threads:[~2024-06-10 15:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-07 19:16 [Bug tree-optimization/115388] New: wrong code at -O3 on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2024-06-07 23:50 ` [Bug middle-end/115388] [15 Regression] " pinskia at gcc dot gnu.org
2024-06-09 12:37 ` [Bug middle-end/115388] [15 Regression] wrong code at -O3 on x86_64-linux-gnu since r15-571-g1e0ae1f52741f7 sjames at gcc dot gnu.org
2024-06-10  6:35 ` rguenth at gcc dot gnu.org
2024-06-10  9:26 ` rguenth at gcc dot gnu.org
2024-06-10 11:36 ` cvs-commit at gcc dot gnu.org
2024-06-10 11:37 ` rguenth at gcc dot gnu.org
2024-06-10 14:31 ` wilco at gcc dot gnu.org
2024-06-10 14:38 ` pinskia at gcc dot gnu.org
2024-06-10 15:27 ` cvs-commit 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).