Bug 89242 - ICE in verify_dominators, at dominance.c:1184 (error: dominator of 7 should be 5, not 2)
Summary: ICE in verify_dominators, at dominance.c:1184 (error: dominator of 7 should b...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 9.0
: P2 normal
Target Milestone: 7.5
Assignee: Martin Liška
URL:
Keywords: EH, ice-checking, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2019-02-07 17:47 UTC by Arseny Solokha
Modified: 2019-02-15 11:01 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 6.3.0, 7.4.1, 8.2.1, 9.0
Known to fail:
Last reconfirmed: 2019-02-08 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arseny Solokha 2019-02-07 17:47:59 UTC
g++-9.0.0-alpha20190203 snapshot (r268503) ICEs when compiling gcc/testsuite/g++.dg/opt/pr47280.C w/ -O2 (-O3, -Ofast, -Os) -fdelete-dead-exceptions -fnon-call-exceptions -ftrapv -fno-rerun-cse-after-loop -fno-forward-propagate -fno-tree-loop-optimize:

% g++-9.0.0-alpha20190203 -O2 -fdelete-dead-exceptions -fnon-call-exceptions -ftrapv -fno-rerun-cse-after-loop -fno-forward-propagate -fno-tree-loop-optimize -c gcc/testsuite/g++.dg/opt/pr47280.C
gcc/testsuite/g++.dg/opt/pr47280.C: In function 'void bar(int, char*)':
gcc/testsuite/g++.dg/opt/pr47280.C:14:1: error: dominator of 7 should be 5, not 2
   14 | }
      | ^
during RTL pass: ce2
gcc/testsuite/g++.dg/opt/pr47280.C:14:1: internal compiler error: in verify_dominators, at dominance.c:1184
0x6b99b0 verify_dominators(cdi_direction)
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190203/work/gcc-9-20190203/gcc/dominance.c:1184
0xbbdcbe checking_verify_dominators
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190203/work/gcc-9-20190203/gcc/dominance.h:76
0xbbdcbe calculate_dominance_info(cdi_direction)
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190203/work/gcc-9-20190203/gcc/dominance.c:717
0xb52de2 flow_loops_find(loops*)
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190203/work/gcc-9-20190203/gcc/cfgloop.c:431
0xe0221e loop_optimizer_init(unsigned int)
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190203/work/gcc-9-20190203/gcc/loop-init.c:93
0x1820753 if_convert
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190203/work/gcc-9-20190203/gcc/ifcvt.c:5374
0x182315d execute
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190203/work/gcc-9-20190203/gcc/ifcvt.c:5553
Comment 1 Martin Liška 2019-02-08 08:31:08 UTC
Confirmed, started with r236114. I can work on that.
Comment 2 Martin Liška 2019-02-12 14:13:09 UTC
I've got a patch candidate for it, testing now..
Comment 3 Martin Liška 2019-02-14 11:31:31 UTC
Author: marxin
Date: Thu Feb 14 11:30:58 2019
New Revision: 268873

URL: https://gcc.gnu.org/viewcvs?rev=268873&root=gcc&view=rev
Log:
Call free_dominance_info when transformed in DCE (PR rtl-optimization/89242).

2019-02-14  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/89242
	* dce.c (delete_unmarked_insns): Call free_dominance_info we
	process a transformation.
2019-02-14  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/89242
	* g++.dg/pr89242.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/pr89242.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dce.c
    trunk/gcc/testsuite/ChangeLog
Comment 4 Martin Liška 2019-02-14 11:34:15 UTC
Fixed on trunk so far.
Comment 5 Martin Liška 2019-02-14 13:58:23 UTC
Author: marxin
Date: Thu Feb 14 13:57:52 2019
New Revision: 268876

URL: https://gcc.gnu.org/viewcvs?rev=268876&root=gcc&view=rev
Log:
Backport r268873

2019-02-14  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-14  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/89242
	* dce.c (delete_unmarked_insns): Call free_dominance_info we
	process a transformation.
2019-02-14  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-14  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/89242
	* g++.dg/pr89242.C: New test.

Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/dce.c
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
Comment 6 Martin Liška 2019-02-15 10:59:34 UTC
Author: marxin
Date: Fri Feb 15 10:59:02 2019
New Revision: 268938

URL: https://gcc.gnu.org/viewcvs?rev=268938&root=gcc&view=rev
Log:
Backport r268873

2019-02-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-14  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/89242
	* dce.c (delete_unmarked_insns): Call free_dominance_info we
	process a transformation.
2019-02-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-14  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/89242
	* g++.dg/pr89242.C: New test.

Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/dce.c
    branches/gcc-7-branch/gcc/testsuite/ChangeLog
Comment 7 Martin Liška 2019-02-15 11:01:22 UTC
Fixed on all active branches.