public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110509] New: wrong code at -O3 on x86_64-linux-gnu (nondeterministic hang)
@ 2023-07-01  5:18 zhendong.su at inf dot ethz.ch
  2023-07-01  5:22 ` [Bug tree-optimization/110509] " pinskia at gcc dot gnu.org
  2023-07-01  5:24 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2023-07-01  5:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110509
           Summary: wrong code at -O3 on x86_64-linux-gnu
                    (nondeterministic hang)
           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.

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

[521] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../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
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230701 (experimental) (GCC) 
[522] % 
[522] % gcctk -O3 small.c
[523] % for i in $(seq 1 10); do
> echo $i
> timeout -s 9 5 ./a.out
> done
1
2
3
4
Killed
5
6
7
Killed
8
Killed
9
Killed
10
Killed
[524] % 
[524] % cat small.c
int printf (const char *, ...);
int a, d = 10, b = 8, c, e, i, r, f, j;
int g (short l) {
  if (d)
    return l;
}
int main () {
  int m[] = {987, 1, 47}, p, o = 2;
 L1:
  p = g (m[2] >= 8);
  while (1) {
    while (p > 1)
      while (r) {
        int h = m[a];
        while (1)
          ;
      }
    while (i < 9) {
      if (c && f) {
        if (o) {
          p = 7 ^ j;
          b = o = 0;
          if (p <= 4) {
            printf ("%d", j);
            goto L2;
          }
        }
        if (j)
          goto L1;
      L2:
        b > 1;
      }
      if (b)
        return e;
    }
  }
  return 0;
}

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

* [Bug tree-optimization/110509] wrong code at -O3 on x86_64-linux-gnu (nondeterministic hang)
  2023-07-01  5:18 [Bug tree-optimization/110509] New: wrong code at -O3 on x86_64-linux-gnu (nondeterministic hang) zhendong.su at inf dot ethz.ch
@ 2023-07-01  5:22 ` pinskia at gcc dot gnu.org
  2023-07-01  5:24 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-01  5:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Oh this one.

  # _37 = PHI <_39(D)(2), _2(13)>
L1:
  d.0_35 = d;
  _36 = d.0_35 != 0;
  _14 = (int) _36;
  _2 = _14 | _37;
  goto <bb 7>; [100.00%]

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

* [Bug tree-optimization/110509] wrong code at -O3 on x86_64-linux-gnu (nondeterministic hang)
  2023-07-01  5:18 [Bug tree-optimization/110509] New: wrong code at -O3 on x86_64-linux-gnu (nondeterministic hang) zhendong.su at inf dot ethz.ch
  2023-07-01  5:22 ` [Bug tree-optimization/110509] " pinskia at gcc dot gnu.org
@ 2023-07-01  5:24 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-01  5:24 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 110228.

*** This bug has been marked as a duplicate of bug 110228 ***

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

end of thread, other threads:[~2023-07-01  5:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-01  5:18 [Bug tree-optimization/110509] New: wrong code at -O3 on x86_64-linux-gnu (nondeterministic hang) zhendong.su at inf dot ethz.ch
2023-07-01  5:22 ` [Bug tree-optimization/110509] " pinskia at gcc dot gnu.org
2023-07-01  5:24 ` 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).