[Bug tree-optimization/113237] [14 Regression] ICE verify_ssa failed when building 500.perlbench_r since r14-6822-g01f4251b8775c8

2024-01-12 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113237

Tamar Christina  changed:

   What|Removed |Added

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

--- Comment #6 from Tamar Christina  ---
Fixed. Thanks for the report and let me know if there's something still broken.

[Bug tree-optimization/113237] [14 Regression] ICE verify_ssa failed when building 500.perlbench_r since r14-6822-g01f4251b8775c8

2024-01-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113237

--- Comment #5 from GCC Commits  ---
The master branch has been updated by Tamar Christina :

https://gcc.gnu.org/g:99c0a540d6689ede068f9ba98af6f38c3cd71362

commit r14-7196-g99c0a540d6689ede068f9ba98af6f38c3cd71362
Author: Tamar Christina 
Date:   Fri Jan 12 15:25:58 2024 +

middle-end: thread through existing LCSSA variable for alternative exits
too [PR113237]

Builing on top of the previous patch, similar to when we have a single exit
if
we have a case where all exits are considered early exits and there are
existing
non virtual phi then in order to maintain LCSSA we have to use the existing
PHI
variables.  We can't simply clear them and just rebuild them because the
order
of the PHIs in the main exit must match the original exit for when we add
the
skip_epilog guard.

But the infrastructure is already in place to maintain them, we just have
to use
the right value.

gcc/ChangeLog:

PR tree-optimization/113237
* tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg):
Use
existing LCSSA variable for exit when all exits are early break.

gcc/testsuite/ChangeLog:

PR tree-optimization/113237
* gcc.dg/vect/vect-early-break_98-pr113237.c: New test.

[Bug tree-optimization/113237] [14 Regression] ICE verify_ssa failed when building 500.perlbench_r since r14-6822-g01f4251b8775c8

2024-01-07 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113237

--- Comment #4 from Tamar Christina  ---
Created attachment 57003
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57003=edit
perlbench.patch

submitted patch

[Bug tree-optimization/113237] [14 Regression] ICE verify_ssa failed when building 500.perlbench_r since r14-6822-g01f4251b8775c8

2024-01-04 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113237

Tamar Christina  changed:

   What|Removed |Added

   Priority|P3  |P1
   Last reconfirmed||2024-01-04
 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |tnfchris at gcc dot 
gnu.org
 Status|UNCONFIRMED |ASSIGNED

--- Comment #3 from Tamar Christina  ---
Thanks,

Indeed the patch for PR 113137 won't fix this one as it looks like the peeling
code has gotten confused about which exit is which when adjusting
virtual_operands.

It looks like it's swapped them, and this happens because non of the loop exits
are counting one so it just picks a random one.

Looks the one it picks is not the latch connected one:

perl.c:10:8: note:   using as main loop exit: 11 -> 7 [AUX: (nil)]
perl.c:10:8: note:=== get_loop_niters ===
perl.c:10:8: note:Loop has 2 exits.
perl.c:10:8: note:Analyzing exit 0...
perl.c:10:8: note:Analyzing exit 1...

which then incorrectly peels:

 # iters_46 = PHI 

which should be:

 # iters_46 = PHI 

I started implemented a fix for this same situation earlier for PR 113178 but
didn't finish it because I didn't think we'd get this far with a legit loop.

I'll finish that part.  Thanks for the testcase!

[Bug tree-optimization/113237] [14 Regression] ICE verify_ssa failed when building 500.perlbench_r since r14-6822-g01f4251b8775c8

2024-01-04 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113237

--- Comment #2 from Tamar Christina  ---
Ah wait, I see. Ok, taking a look.

[Bug tree-optimization/113237] [14 Regression] ICE verify_ssa failed when building 500.perlbench_r since r14-6822-g01f4251b8775c8

2024-01-04 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113237

--- Comment #1 from Tamar Christina  ---
> I have bisected the failure to r14-6822-g01f4251b8775c8 (middle-end: Support
> vectorization of loops with multiple exits).  I have tried if the patch
> attached to PR 113137 helps but unfortunately it does not.

Indeed this should be fixed by the patch in PR 113136 not 113137 :)

[Bug tree-optimization/113237] [14 Regression] ICE verify_ssa failed when building 500.perlbench_r since r14-6822-g01f4251b8775c8

2024-01-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113237

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org
   Keywords||ice-on-valid-code
   Target Milestone|--- |14.0