Commit 50bf47fd by Richard Biener Committed by Richard Biener

re PR tree-optimization/71802 (gcc ICE at -O3 on valid code on x86_64-linux-gnu…

re PR tree-optimization/71802 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in expand_LOOP_VECTORIZED)

2016-08-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71802
	* tree-cfgcleanup.c (cleanup_tree_cfg_bb): Make sure to catch
	all merge opportunities with the predecessor.

	* gcc.dg/torture/pr71802.c: New testcase.

From-SVN: r239274
parent fe7afdf5
2016-08-09 Richard Biener <rguenther@suse.de> 2016-08-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/71802
* tree-cfgcleanup.c (cleanup_tree_cfg_bb): Make sure to catch
all merge opportunities with the predecessor.
2016-08-09 Richard Biener <rguenther@suse.de>
PR ipa/68273 PR ipa/68273
* ipa-prop.c (ipa_modify_formal_parameters): Build * ipa-prop.c (ipa_modify_formal_parameters): Build
parameter types with natural alignment also for the parameter types with natural alignment also for the
......
2016-08-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/71802
* gcc.dg/torture/pr71802.c: New testcase.
2016-08-09 Jakub Jelinek <jakub@redhat.com> 2016-08-09 Jakub Jelinek <jakub@redhat.com>
PR c++/72809 PR c++/72809
......
/* { dg-do compile } */
int b, c;
long d, f;
void fn1()
{
char g;
long long h = 0;
int *i;
if (0) {
L2:
b && (b = f);
d = 3;
for (; d;) {
char *j = &g;
c = *j = 0;
L3:
*j %= b;
for (; g <= 4;)
;
}
goto L2;
}
for (; *i; *i = 1) {
if ((h -= 4) == (h != (b ?: d))) {
g = 3;
goto L3;
}
i = (int *)&h;
*i = f;
i = (int *)&f;
if ((h && 6) - (h = 0))
goto L2;
}
for (; d;)
goto L3;
}
...@@ -641,24 +641,25 @@ cleanup_tree_cfg_bb (basic_block bb) ...@@ -641,24 +641,25 @@ cleanup_tree_cfg_bb (basic_block bb)
&& remove_forwarder_block (bb)) && remove_forwarder_block (bb))
return true; return true;
/* If there is a merge opportunity with the predecessor
do nothing now but wait until we process the predecessor.
This happens when we visit BBs in a non-optimal order and
avoids quadratic behavior with adjusting stmts BB pointer. */
if (single_pred_p (bb)
&& can_merge_blocks_p (single_pred (bb), bb))
/* But make sure we _do_ visit it. When we remove unreachable paths
ending in a backedge we fail to mark the destinations predecessors
as changed. */
bitmap_set_bit (cfgcleanup_altered_bbs, single_pred (bb)->index);
/* Merging the blocks may create new opportunities for folding /* Merging the blocks may create new opportunities for folding
conditional branches (due to the elimination of single-valued PHI conditional branches (due to the elimination of single-valued PHI
nodes). */ nodes). */
if (single_succ_p (bb) else if (single_succ_p (bb)
&& can_merge_blocks_p (bb, single_succ (bb))) && can_merge_blocks_p (bb, single_succ (bb)))
{ {
/* If there is a merge opportunity with the predecessor merge_blocks (bb, single_succ (bb));
do nothing now but wait until we process the predecessor. return true;
This happens when we visit BBs in a non-optimal order and
avoids quadratic behavior with adjusting stmts BB pointer. */
if (single_pred_p (bb)
&& can_merge_blocks_p (single_pred (bb), bb))
;
else
{
merge_blocks (bb, single_succ (bb));
return true;
}
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment