Created attachment 44677 [details] Testcase gcc-9.0.0-alpha20180909 snapshot (r264185) ICEs when compiling the attached snippet w/ -O2 (-Os, -O3, -Ofast) --param rpo-vn-max-loop-depth=5: % gcc-9.0.0-alpha20180909 -O2 --param rpo-vn-max-loop-depth=5 -w -c rilo1emt.c during GIMPLE pass: fre rilo1emt.c: In function 'j8': rilo1emt.c:58:1: internal compiler error: in set_ssa_val_to, at tree-ssa-sccvn.c:3647 58 | } | ^ 0x699fa5 set_ssa_val_to /var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-ssa-sccvn.c:3647 0xe63d78 visit_phi /var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-ssa-sccvn.c:4261 0xe6435f visit_stmt /var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-ssa-sccvn.c:4304 0xe65e89 process_bb /var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-ssa-sccvn.c:5923 0xe671a8 do_rpo_vn /var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-ssa-sccvn.c:6454 0xe67f8c execute /var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-ssa-sccvn.c:6646
Mine.
Here we're running into the not executable but limited region where we marked not only backedges as executable but also destination BBs as reachable. Things go downhill here because we end up with with all sorts of weird state this way. So this is related to (and probably caused by) r264057 and PR87169.
Fixed.
Author: rguenth Date: Wed Sep 12 14:03:21 2018 New Revision: 264241 URL: https://gcc.gnu.org/viewcvs?rev=264241&root=gcc&view=rev Log: 2018-09-12 Richard Biener <rguenther@suse.de> PR tree-optimization/87280 * tree-ssa-sccvn.c (process_bb): Handle the case of executable edge but unreachable target. (do_rpo_vn): For conservatively handling a PHI only mark the backedge executable but not the block reachable. * gcc.dg/torture/pr87280.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/torture/pr87280.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-sccvn.c