[Bug tree-optimization/108574] [13 Regression] wrong code at -Os and above on x86_64-linux-gnu

2023-01-30 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108574

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Richard Biener  ---
Fixed.

[Bug tree-optimization/108574] [13 Regression] wrong code at -Os and above on x86_64-linux-gnu

2023-01-30 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108574

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:7ac3e69e311351b70407d7f87a0169c4d463e57b

commit r13-5492-g7ac3e69e311351b70407d7f87a0169c4d463e57b
Author: Richard Biener 
Date:   Mon Jan 30 09:25:23 2023 +0100

tree-optimization/108574 - wrong-code with PRE PHI node processing

The PR108523 was too optimistic in replacing the same value with
an equivalence from a possibly not taken edge.  The following
rectifies this and instead refrains from using the equivalence in
the problematic cases.

PR tree-optimization/108574
* tree-ssa-sccvn.cc (visit_phi): Instead of swapping
sameval and def, ignore the equivalence if there's the
danger of oscillating between two values.

* gcc.dg/torture/pr108574-1.c: New testcase.
* gcc.dg/torture/pr108574-2.c: Likewise.
* gcc.dg/torture/pr108574-3.c: Likewise.

[Bug tree-optimization/108574] [13 Regression] wrong code at -Os and above on x86_64-linux-gnu

2023-01-30 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108574

--- Comment #5 from Richard Biener  ---
*** Bug 108584 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/108574] [13 Regression] wrong code at -Os and above on x86_64-linux-gnu

2023-01-30 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108574

Richard Biener  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
   Priority|P3  |P1
 Status|NEW |ASSIGNED
Version|unknown |13.0

--- Comment #4 from Richard Biener  ---
Likely caused by r13-5348-gc29d85359add80

We do

marking outgoing edge 12 -> 6 executable
Looking for changed values of backedge 12->6 destination PHIs
Predication says 0 and e_10 are equal on edge 11 -> 6
Setting value number of e_5 to 0

I will have a more detailed look.

[Bug tree-optimization/108574] [13 Regression] wrong code at -Os and above on x86_64-linux-gnu

2023-01-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108574

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
Summary|wrong code at -Os and above |[13 Regression] wrong code
   |on x86_64-linux-gnu |at -Os and above on
   ||x86_64-linux-gnu
   Target Milestone|--- |13.0
   Keywords||wrong-code
   Last reconfirmed||2023-01-27
 Status|UNCONFIRMED |NEW

--- Comment #3 from Andrew Pinski  ---
(In reply to Zhendong Su from comment #0)
> It appears to be a recent regression from 12.2.

In the testcase from comment #0, pre is messing it up because of an
uninitialized variable on one path (which is not taken).

Note somehow the statement:
d >= b;
changes the IR slightly ...

testcase in comment #1 also depends on an uninitialized variable on a path not
taken too (in that case j).

testcase in comment #2 also looks similar and depends on an unintialized
variable on a path not taken too.