[Bug tree-optimization/103219] [12 Regression] ICE Segmentation fault at -O3 (during GIMPLE pass: unrolljam) since r12-4526-gd8edfadfc7a9795b

2022-02-17 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103219

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED
   Target Milestone|9.5 |12.0
Summary|[9/10/11 Regression] ICE|[12 Regression] ICE
   |Segmentation fault at -O3   |Segmentation fault at -O3
   |(during GIMPLE pass:|(during GIMPLE pass:
   |unrolljam) since|unrolljam) since
   |r12-4526-gd8edfadfc7a9795b  |r12-4526-gd8edfadfc7a9795b

--- Comment #6 from Richard Biener  ---
Actually the use was new in GCC 12.

[Bug tree-optimization/103219] [12 Regression] ICE Segmentation fault at -O3 (during GIMPLE pass: unrolljam) since r12-4526-gd8edfadfc7a9795b

2021-11-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103219

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

https://gcc.gnu.org/g:d1ca8aeaf34a717dffd8f4a1f0333d25c7d1c904

commit r12-5264-gd1ca8aeaf34a717dffd8f4a1f0333d25c7d1c904
Author: Richard Biener 
Date:   Mon Nov 15 11:07:55 2021 +0100

tree-optimization/103219 - avoid ICE in unroll-and-jam

For no particularly good reason unroll-and-jam uses single_dom_exit
to determine the exit for the region it wants to run VN on.  That
happens to ICE because of the dominance restriction.  Use single_exit
instead.

2021-11-15  Richard Biener  

PR tree-optimization/103219
* gimple-loop-jam.c (tree_loop_unroll_and_jam): Use single_exit
to determine the exit for the VN region.

* gcc.dg/torture/pr103219.c: New testcase.

[Bug tree-optimization/103219] [12 Regression] ICE Segmentation fault at -O3 (during GIMPLE pass: unrolljam) since r12-4526-gd8edfadfc7a9795b

2021-11-15 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103219

Richard Biener  changed:

   What|Removed |Added

 CC||matz at gcc dot gnu.org
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org

--- Comment #3 from Richard Biener  ---
I think for the case in question the code should simply use single_exit (). 
But as was said the issue is latent.

[Bug tree-optimization/103219] [12 Regression] ICE Segmentation fault at -O3 (during GIMPLE pass: unrolljam) since r12-4526-gd8edfadfc7a9795b

2021-11-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103219

--- Comment #2 from Andrew Pinski  ---
(In reply to Aldy Hernandez from comment #1)
> Looks like a latent bug elsewhere as we're not threading anything.  For that
> matter, test fails even with -fno-thread-jumps.

Right, it is a dup of one of the other bugs listed in see also.  The code in
unrolljam is suspect as mentioned in one of them (I can't remember which one).

[Bug tree-optimization/103219] [12 Regression] ICE Segmentation fault at -O3 (during GIMPLE pass: unrolljam) since r12-4526-gd8edfadfc7a9795b

2021-11-14 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103219

Aldy Hernandez  changed:

   What|Removed |Added

   Last reconfirmed||2021-11-14
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #1 from Aldy Hernandez  ---
Looks like a latent bug elsewhere as we're not threading anything.  For that
matter, test fails even with -fno-thread-jumps.

$ ./cc1 a.c -O3 -fno-thread-jumps -quiet -w
during GIMPLE pass: unrolljam
a.c: In function ‘main’:
a.c:3:5: internal compiler error: Segmentation fault
3 | int main() {
  | ^~~~
0x133a4fb crash_signal


Seems like tree_loop_unroll_and_jam is dereferencing a null return from
single_dom_exit():

  auto_bitmap exit_bbs;
  bitmap_set_bit (exit_bbs, single_dom_exit (outer)->dest->index);
  todo |= do_rpo_vn (cfun, loop_preheader_edge (outer), exit_bbs);

(gdb) p debug(outer)
loop_1 (header = 9, latch = 26, niter = )
$6 = void
(gdb) p single_dom_exit (outer)
$7 =