public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/112581] New: wrong code at -O2 and -O3 on x86_64-linux-gnu (generated code hangs)
@ 2023-11-17  5:07 zhendong.su at inf dot ethz.ch
  2023-11-17  5:13 ` [Bug middle-end/112581] " pinskia at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2023-11-17  5:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112581
           Summary: wrong code at -O2 and -O3 on x86_64-linux-gnu
                    (generated code hangs)
           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 should be a very recent regression as it does not seem to reproduce with
the latest build on Compiler Explorer. 


[530] % 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.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 14.0.0 20231117 (experimental) (GCC) 
[531] % 
[531] % gcctk -Os small.c
[532] % ./a.out
[533] % 
[533] % gcctk -O2 small.c
[534] % timeout -s 9 5 ./a.out
Killed
[535] % 
[535] % cat small.c
int a = -1, b = 2501896061, c, d, e, f = 3, g;
int main() {
  unsigned h;
  int i;
  d = 0;
  for (; d < 1; d++) {
    int j = ~-((6UL ^ a) / b);
    if (b)
    L:
      if (!f)
        continue;
    if (c)
      i = 1;
    if (j) {
      i = 0;
      while (e)
        ;
    }
    g = -1 % b;
    h = ~(b || h);
    f = g || 0;
    a = a || 0;
    if (!a)
      h = 0;
    while (h > 4294967294)
      if (i)
        break;
    if (c)
      goto L;
  }
  return 0;
}

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

end of thread, other threads:[~2024-01-10 17:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-17  5:07 [Bug tree-optimization/112581] New: wrong code at -O2 and -O3 on x86_64-linux-gnu (generated code hangs) zhendong.su at inf dot ethz.ch
2023-11-17  5:13 ` [Bug middle-end/112581] " pinskia at gcc dot gnu.org
2023-11-17  7:15 ` [Bug middle-end/112581] [14 Regression] " rguenth at gcc dot gnu.org
2023-11-17  9:26 ` ubizjak at gmail dot com
2023-11-17 11:16 ` [Bug middle-end/112581] [14 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu (generated code hangs) since r14-4661 jakub at gcc dot gnu.org
2023-11-17 22:41 ` pinskia at gcc dot gnu.org
2023-11-17 23:04 ` pinskia at gcc dot gnu.org
2023-11-17 23:14 ` pinskia at gcc dot gnu.org
2023-11-17 23:18 ` pinskia at gcc dot gnu.org
2023-11-17 23:25 ` pinskia at gcc dot gnu.org
2023-11-18  4:09 ` [Bug middle-end/112581] [14 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu (generated code hangs) since r14-4661 due to reassoc not handling maybe_undefs pinskia at gcc dot gnu.org
2023-12-21 21:07 ` pinskia at gcc dot gnu.org
2023-12-23 18:36 ` pinskia at gcc dot gnu.org
2024-01-10 17:11 ` cvs-commit at gcc dot gnu.org
2024-01-10 17:11 ` pinskia 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).