Bug 87280 - [9 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:3647
Summary: [9 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:3647
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: 9.0
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2018-09-11 11:14 UTC by Arseny Solokha
Modified: 2018-09-12 14:03 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-09-12 00:00:00


Attachments
Testcase (215 bytes, text/plain)
2018-09-11 11:14 UTC, Arseny Solokha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arseny Solokha 2018-09-11 11:14:45 UTC
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
Comment 1 Richard Biener 2018-09-12 08:58:15 UTC
Mine.
Comment 2 Richard Biener 2018-09-12 11:30:19 UTC
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.
Comment 3 Richard Biener 2018-09-12 14:03:27 UTC
Fixed.
Comment 4 Richard Biener 2018-09-12 14:03:57 UTC
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