re PR tree-optimization/71503 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in "gen_phi_arg_condition")

PR tree-optimization/71503
	PR tree-optimization/71683
	* tree-if-conv.c (gen_phi_arg_condition): Record true predicate
	and break.

	gcc/testsuite
	PR tree-optimization/71503
	PR tree-optimization/71683
	* gcc.dg/tree-ssa/ifc-pr71503.c: New test.
	* gcc.dg/tree-ssa/ifc-pr71683.c: New test.

From-SVN: r238512
This commit is contained in:
Bin Cheng 2016-07-20 08:31:35 +00:00 committed by Bin Cheng
parent 21f8810377
commit 04ac4afa84
5 changed files with 61 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2016-07-20 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/71503
PR tree-optimization/71683
* tree-if-conv.c (gen_phi_arg_condition): Record true predicate
and break.
2016-07-20 Martin Liska <mliska@suse.cz>
* doc/invoke.texi (-fipa-ra): Document when the option is

View File

@ -1,3 +1,10 @@
2016-07-20 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/71503
PR tree-optimization/71683
* gcc.dg/tree-ssa/ifc-pr71503.c: New test.
* gcc.dg/tree-ssa/ifc-pr71683.c: New test.
2016-07-20 Martin Liska <mliska@suse.cz>
* gcc.dg/plugin/plugin.exp: Remove sreal test.

View File

@ -0,0 +1,18 @@
/* { dg-do compile } */
/* { dg-options "-Ofast" { target *-*-* } } */
int a, b;
unsigned long d;
void fn1() {
unsigned long *h = &d;
line1 : {
int i = 4;
for (; b; i++) {
d = ((d + 6 ?: *h) ? a : 7) && (i &= 0 >= b);
b += a;
}
}
h = 0;
for (; *h;)
goto line1;
}

View File

@ -0,0 +1,25 @@
/* { dg-do compile } */
/* { dg-options "-Ofast" { target *-*-* } } */
short unsigned int ve;
void
u1 (void)
{
int oq = 0;
while (ve != 0)
{
int j4, w7 = oq;
oq = 0 / oq;
ve %= oq;
j4 = ve ^ 1;
ve ^= oq;
if (j4 != 0 ? j4 : ve)
oq = ve;
else
if (w7 != 0)
oq = ve;
}
}

View File

@ -1687,7 +1687,10 @@ gen_phi_arg_condition (gphi *phi, vec<int> *occur,
e = gimple_phi_arg_edge (phi, (*occur)[i]);
c = bb_predicate (e->src);
if (is_true_predicate (c))
continue;
{
cond = c;
break;
}
c = force_gimple_operand_gsi_1 (gsi, unshare_expr (c),
is_gimple_condexpr, NULL_TREE,
true, GSI_SAME_STMT);