This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PR50878, PATCH] Fix for verify_dominators in -ftree-tail-merge
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 30 Oct 2011 09:20:06 +0100
- Subject: [PR50878, PATCH] Fix for verify_dominators in -ftree-tail-merge
Richard,
I have a fix for PR50878.
A simplified form of the problem from the test-case of the PR is shown in this
cfg. Block 12 has as direct dominator block 5.
5
/ \
/ \
* *
6 7
| |
| |
* *
8 9
\ /
\ /
*
12
tail_merge_optimize finds that blocks 6 and 7 are duplicates. After replacing
block 7 by block 6, the cfg looks like this:
5
|
|
*
6
/ \
/ \
* *
8 9
\ /
\ /
*
12
The new direct dominator of block 12 is block 6, but the current algorithm only
recalculates dominator info for blocks 6, 8 and 9.
The patch fixes this by additionally recalculating the dominator info for blocks
immediately dominated by bb2 (block 6 in the example), if bb2 has a single
predecessor after replacement.
Bootstapped and reg-tested on x86_64 and i686. Build and reg-tested on MIPS and ARM.
Ok for trunk?
Thanks,
- Tom
2011-10-30 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/50878
* tree-ssa-tail-merge.c (replace_block_by): Recalculate dominator info
for blocks immediately dominated by bb2, if bb2 has a single predecessor
after replacement.