[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-12-05 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

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

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-12-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

--- Comment #14 from GCC Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:8ff02df62935429d8956361cfdb897122492523d

commit r14-6181-g8ff02df62935429d8956361cfdb897122492523d
Author: Richard Biener 
Date:   Tue Dec 5 08:50:57 2023 +0100

tree-optimization/112856 - fix LC SSA after loop header copying

When loop header copying unloops loops we have to possibly fixup
LC SSA.  I've take the opportunity to streamline the unloop_loops
API, removing the use of a ivcanon local global variable.

PR tree-optimization/109689
PR tree-optimization/112856
* cfgloopmanip.h (unloop_loops): Adjust API.
* tree-ssa-loop-ivcanon.cc (unloop_loops): Take edges_to_remove
as parameter.
(canonicalize_induction_variables): Adjust.
(tree_unroll_loops_completely): Likewise.
* tree-ssa-loop-ch.cc (ch_base::copy_headers): Rewrite into
LC SSA if we unlooped some loops and we are in LC SSA.

* gcc.dg/torture/pr109689.c: New testcase.
* gcc.dg/torture/pr112856.c: Likewise.

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-12-04 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

--- Comment #13 from Sam James  ---
*** Bug 111678 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-11-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

Andrew Pinski  changed:

   What|Removed |Added

 CC||141242068 at smail dot 
nju.edu.cn

--- Comment #12 from Andrew Pinski  ---
*** Bug 112489 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-11-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

Andrew Pinski  changed:

   What|Removed |Added

 CC||shaohua.li at inf dot ethz.ch

--- Comment #11 from Andrew Pinski  ---
*** Bug 111389 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-06-28 Thread hubicka at ucw dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

--- Comment #10 from Jan Hubicka  ---
> > So perhaps simply:
> >   rewrite_into_loop_closed_ssa (NULL, 0);
> > in case we unlooped in loop closed ssa form (which is not that common).
> > Would that be acceptable?
> 
> Yes, we do that in other places as well.
OK, I will test the fix.

Thanks
Honza

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-06-28 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

--- Comment #9 from Richard Biener  ---
(In reply to Jan Hubicka from comment #8)
> An easy way would be to avoid unlooping if tree_ssa_loop_ch is executed in
> loop closed ssa (which happens from ch_vect pass).
> 
> I wonder how hard would be however to get this right?
> I think this means to take the basic block we turn into unreachable and look
> on its predecessors that are in loop introducing new PHIs and renaming. 
> This is bit involved to do by hand.
> 
> So perhaps simply:
>   rewrite_into_loop_closed_ssa (NULL, 0);
> in case we unlooped in loop closed ssa form (which is not that common).
> Would that be acceptable?

Yes, we do that in other places as well.

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-06-23 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

--- Comment #8 from Jan Hubicka  ---
An easy way would be to avoid unlooping if tree_ssa_loop_ch is executed in loop
closed ssa (which happens from ch_vect pass).

I wonder how hard would be however to get this right?
I think this means to take the basic block we turn into unreachable and look on
its predecessors that are in loop introducing new PHIs and renaming.  This is
bit involved to do by hand.

So perhaps simply:
  rewrite_into_loop_closed_ssa (NULL, 0);
in case we unlooped in loop closed ssa form (which is not that common). Would
that be acceptable?

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-06-20 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

--- Comment #7 from Zhendong Su  ---
Another related and smaller reproducer:

[514] % gcctk -O3 -fno-tree-loop-ivcanon small.c
during GIMPLE pass: ch_vect
small.c: In function ‘main’:
small.c:3:5: internal compiler error: in check_loop_closed_ssa_def, at
tree-ssa-loop-manip.cc:647
3 | int main() {
  | ^~~~
0x81089b check_loop_closed_ssa_def
../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:647
0x1137d37 check_loop_closed_ssa_bb
../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:672
0x1138116 verify_loop_closed_ssa(bool, loop*)
../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:697
0x1138116 verify_loop_closed_ssa(bool, loop*)
../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:681
0xe9ff39 execute_function_todo
../../gcc-trunk/gcc/passes.cc:2116
0xea032b execute_todo
../../gcc-trunk/gcc/passes.cc:2152
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
[515] % 
[515] % cat small.c
int a;
unsigned c;
int main() {
 L:
  if (c)
for (; c < 2;) {
  int e;
  for (a = 0; a < 2; a++) {
c++;
while (e)
  goto L;
  }
}
  return 0;
}

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-06-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

--- Comment #6 from Andrew Pinski  ---
*** Bug 110135 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-06-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

Andrew Pinski  changed:

   What|Removed |Added

 CC||19373742 at buaa dot edu.cn

--- Comment #5 from Andrew Pinski  ---
*** Bug 110123 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/109689] [14 Regression] ICE at -O1 with "-ftree-vectorize": in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r14-301-gf2d6beb7a4ddf1

2023-05-02 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689

Martin Liška  changed:

   What|Removed |Added

Summary|[14 Regression] ICE at -O1  |[14 Regression] ICE at -O1
   |with "-ftree-vectorize": in |with "-ftree-vectorize": in
   |check_loop_closed_ssa_def,  |check_loop_closed_ssa_def,
   |at  |at
   |tree-ssa-loop-manip.cc:645  |tree-ssa-loop-manip.cc:645
   ||since
   ||r14-301-gf2d6beb7a4ddf1
 CC||marxin at gcc dot gnu.org

--- Comment #4 from Martin Liška  ---
Started with r14-301-gf2d6beb7a4ddf1.