public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/107523] New: wrong code at -O2 and -O3 on x86_64-linux-gnu
@ 2022-11-04  7:25 zhendong.su at inf dot ethz.ch
  2022-11-04 19:45 ` [Bug tree-optimization/107523] [13 Regression] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2022-11-04  7:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107523
           Summary: wrong code at -O2 and -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 12.2 compiles the test correctly.

Compiler Explorer: https://godbolt.org/z/1erPMzzjK

[522] % 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.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
--with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20221104 (experimental) [master r13-3645-gfabe470b244] (GCC) 
[523] % 
[523] % gcctk -Os small.c; ./a.out
[524] % 
[524] % gcctk -O2 small.c
[525] % ./a.out
Floating point exception
[526] % 
[526] % cat small.c
int a, b = 1;
unsigned int c = 1;
int main() {
  int d = 1, f;
  if (b)
    d = 0;
  a = -1;
  b = ~d ^ 465984011;
 L1:;
  if (b < 2)
    f = b;
  b = f;
  if (f <= a) {
    int g = -(a && 1), h = g - f && a, i = ~(c / f) && 1 % (a | h);
    if (c) {
      g = f;
      if (i || (g && (g > -465984012)))
        goto L2;
    }
    c = g | f / c;
  }
  if (0)
  L2:
    a = 0;
  if (a <= c)
    goto L1;
  return 0;
}

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

* [Bug tree-optimization/107523] [13 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu
  2022-11-04  7:25 [Bug tree-optimization/107523] New: wrong code at -O2 and -O3 on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
@ 2022-11-04 19:45 ` pinskia at gcc dot gnu.org
  2022-11-10 15:39 ` [Bug tree-optimization/107523] [13 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu since r13-3628-g6fd485d15c1a2c42 marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-04 19:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-bisection
            Summary|wrong code at -O2 and -O3   |[13 Regression] wrong code
                   |on x86_64-linux-gnu         |at -O2 and -O3 on
                   |                            |x86_64-linux-gnu
   Target Milestone|---                         |13.0

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

* [Bug tree-optimization/107523] [13 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu since r13-3628-g6fd485d15c1a2c42
  2022-11-04  7:25 [Bug tree-optimization/107523] New: wrong code at -O2 and -O3 on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
  2022-11-04 19:45 ` [Bug tree-optimization/107523] [13 Regression] " pinskia at gcc dot gnu.org
@ 2022-11-10 15:39 ` marxin at gcc dot gnu.org
  2022-11-11 19:48 ` cvs-commit at gcc dot gnu.org
  2022-11-11 19:54 ` amacleod at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-11-10 15:39 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[13 Regression] wrong code  |[13 Regression] wrong code
                   |at -O2 and -O3 on           |at -O2 and -O3 on
                   |x86_64-linux-gnu            |x86_64-linux-gnu since
                   |                            |r13-3628-g6fd485d15c1a2c42
   Last reconfirmed|                            |2022-11-10
                 CC|                            |amacleod at redhat dot com,
                   |                            |marxin at gcc dot gnu.org
           Keywords|needs-bisection             |
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r13-3628-g6fd485d15c1a2c42.

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

* [Bug tree-optimization/107523] [13 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu since r13-3628-g6fd485d15c1a2c42
  2022-11-04  7:25 [Bug tree-optimization/107523] New: wrong code at -O2 and -O3 on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
  2022-11-04 19:45 ` [Bug tree-optimization/107523] [13 Regression] " pinskia at gcc dot gnu.org
  2022-11-10 15:39 ` [Bug tree-optimization/107523] [13 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu since r13-3628-g6fd485d15c1a2c42 marxin at gcc dot gnu.org
@ 2022-11-11 19:48 ` cvs-commit at gcc dot gnu.org
  2022-11-11 19:54 ` amacleod at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-11 19:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Macleod <amacleod@gcc.gnu.org>:

https://gcc.gnu.org/g:0a7b437ca71e2721e9bcf070762fc54ef7991aeb

commit r13-3911-g0a7b437ca71e2721e9bcf070762fc54ef7991aeb
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Fri Nov 11 12:22:33 2022 -0500

    Don't add dependencies in update_stmt.

    gimple_ranger::update_stmt has no idea what the context of an update
    is, and should not be adding relations when it re-evaluates a stmt.

            PR tree-optimization/107523
            gcc/
            * gimple-range.cc (gimple_ranger::update_stmt): Use fur_stmt
            rather than fur_depend.

            gcc/testsuite/
            * gcc.dg/pr107523.c: New.

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

* [Bug tree-optimization/107523] [13 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu since r13-3628-g6fd485d15c1a2c42
  2022-11-04  7:25 [Bug tree-optimization/107523] New: wrong code at -O2 and -O3 on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
                   ` (2 preceding siblings ...)
  2022-11-11 19:48 ` cvs-commit at gcc dot gnu.org
@ 2022-11-11 19:54 ` amacleod at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: amacleod at redhat dot com @ 2022-11-11 19:54 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> ---
fixed.

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

end of thread, other threads:[~2022-11-11 19:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04  7:25 [Bug tree-optimization/107523] New: wrong code at -O2 and -O3 on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2022-11-04 19:45 ` [Bug tree-optimization/107523] [13 Regression] " pinskia at gcc dot gnu.org
2022-11-10 15:39 ` [Bug tree-optimization/107523] [13 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu since r13-3628-g6fd485d15c1a2c42 marxin at gcc dot gnu.org
2022-11-11 19:48 ` cvs-commit at gcc dot gnu.org
2022-11-11 19:54 ` amacleod at redhat dot com

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