Commit 14af28ba by Kyrylo Tkachov Committed by Kyrylo Tkachov

[RTL-ifcvt] PR rtl-optimization/68506: Fix emitting order of insns in IF-THEN-JOIN case

	PR rtl-optimization/68506
	* ifcvt.c (noce_try_cmove_arith): Try emitting the else basic block
	first if emit_a exists or then_bb modifies 'b'.  Reindent if-else
	blocks.

	* gcc.c-torture/execute/pr68506.c: New test.

From-SVN: r231003
parent b58d3df2
2015-11-27 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR rtl-optimization/68506
* ifcvt.c (noce_try_cmove_arith): Try emitting the else basic block
first if emit_a exists or then_bb modifies 'b'. Reindent if-else
blocks.
2015-11-27 Martin Liska <mliska@suse.cz>
PR c++/68312
......@@ -2190,7 +2190,7 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
}
}
if (emit_a && modified_in_a)
if (emit_a || modified_in_a)
{
modified_in_b = emit_b != NULL_RTX && modified_in_p (orig_a, emit_b);
if (tmp_b && else_bb)
......@@ -2204,7 +2204,6 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
modified_in_b = true;
break;
}
}
if (modified_in_b)
goto end_seq_and_fail;
......@@ -2222,7 +2221,6 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
if (!noce_emit_bb (emit_b, else_bb, b_simple))
goto end_seq_and_fail;
}
target = noce_emit_cmove (if_info, x, code, XEXP (if_info->cond, 0),
......
2015-11-27 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR rtl-optimization/68506
* gcc.c-torture/execute/pr68506.c: New test.
2015-11-27 Jakub Jelinek <jakub@redhat.com>
PR c/63326
......
/* { dg-options "-fno-builtin-abort" } */
int a, b, m, n, o, p, s, u, i;
char c, q, y;
short d;
unsigned char e;
static int f, h;
static short g, r, v;
unsigned t;
extern void abort ();
int
fn1 (int p1)
{
return a ? p1 : p1 + a;
}
unsigned char
fn2 (unsigned char p1, int p2)
{
return p2 >= 2 ? p1 : p1 >> p2;
}
static short
fn3 ()
{
int w, x = 0;
for (; p < 31; p++)
{
s = fn1 (c | ((1 && c) == c));
t = fn2 (s, x);
c = (unsigned) c > -(unsigned) ((o = (m = d = t) == p) <= 4UL) && n;
v = -c;
y = 1;
for (; y; y++)
e = v == 1;
d = 0;
for (; h != 2;)
{
for (;;)
{
if (!m)
abort ();
r = 7 - f;
x = e = i | r;
q = u * g;
w = b == q;
if (w)
break;
}
break;
}
}
return x;
}
int
main ()
{
fn3 ();
return 0;
}
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