public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/114551] New: wrong code at -O3 on x86_64-linux-gnu
@ 2024-04-01 19:31 zhendong.su at inf dot ethz.ch
  2024-04-01 20:45 ` [Bug tree-optimization/114551] [14 Regression] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2024-04-01 19:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114551
           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: ---

It appears to be a recent regression as it does not reproduce for 13.2 and
earlier. 

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

[587] % 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/14.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
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240401 (experimental) (GCC) 
[588] % 
[588] % gcctk -O2 small.c; ./a.out
[589] % 
[589] % gcctk -O3 small.c
[590] % ./a.out
Segmentation fault
[591] % 
[591] % cat small.c
int a, b[4], c, d, e, f;
int main() {
  a--;
  for (f = 3; f >= 0; f--) {
    for (e = 0; e < 4; e++)
      c = 0;
    for (; c < 4; c++) {
      d = f && a > 0 && f > (2147483647 - a) ? 0 : b[f];
      continue;
    }
  }
  return 0;
}

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

end of thread, other threads:[~2024-05-06 12:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-01 19:31 [Bug tree-optimization/114551] New: wrong code at -O3 on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2024-04-01 20:45 ` [Bug tree-optimization/114551] [14 Regression] " pinskia at gcc dot gnu.org
2024-04-02 11:33 ` rguenth at gcc dot gnu.org
2024-04-02 13:22 ` jakub at gcc dot gnu.org
2024-04-02 23:43 ` [Bug tree-optimization/114551] [14 Regression] wrong code at -O3 on x86_64-linux-gnu since r14-2944 pinskia at gcc dot gnu.org
2024-04-03  3:44 ` pinskia at gcc dot gnu.org
2024-04-03  3:46 ` pinskia at gcc dot gnu.org
2024-04-03 12:27 ` rguenth at gcc dot gnu.org
2024-04-04  7:00 ` cvs-commit at gcc dot gnu.org
2024-04-04  7:01 ` [Bug tree-optimization/114551] [13 " rguenth at gcc dot gnu.org
2024-05-06 12:06 ` [Bug tree-optimization/114551] [14 " rguenth 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).