[PATCH, PR61554] ICE during CCP

Chung-Lin Tang cltang@codesourcery.com
Mon Jun 23 05:32:00 GMT 2014


Hi Richard,

In this change:
https://gcc.gnu.org/ml/gcc-patches/2014-06/msg01278.html

where substitute_and_fold() was changed to use a dom walker, the calls
to purge dead EH edges during the walk can alter the dom-tree, and have
chaotic results; the testcase in PR 61554 has some blocks traversed
twice during the walk, causing the segfault during CCP.

The patch records the to-be-purged-for-dead-EH blocks in a similar
manner like stmts_to_remove, and processes it after the walk. (another
possible method would be using a bitmap to record the BBs + calling
gimple_purge_all_dead_eh_edges...)

Bootstrapped and tested on x86_64-linux, is this okay for trunk?

Thanks,
Chung-Lin

2014-06-23  Chung-Lin Tang  <cltang@codesourcery.com>

	PR tree-optimization/61554
	* tree-ssa-propagate.c (substitute_and_fold_dom_walker):
	Add 'vec<basic_block> bbs_to_purge_dead_eh_edges' member,
	properly update constructor/destructor.
	(substitute_and_fold_dom_walker::before_dom_children):
	Remove call to gimple_purge_dead_eh_edges, add bb to
	bbs_to_purge_dead_eh_edges instead.
	(substitute_and_fold): Call gimple_purge_dead_eh_edges for
	bbs recorded in bbs_to_purge_dead_eh_edges.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr61554.patch
Type: text/x-patch
Size: 1893 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140623/c3424aba/attachment.bin>


More information about the Gcc-patches mailing list