Commit 86efb5cd by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/56494 (ICE in simplify_truncation, at simplify-rtx.c:619)

	PR rtl-optimization/56494
	* simplify-rtx.c (simplify_truncation): If C is narrower than A,
	optimize (truncate:A (subreg:B (truncate:C X) 0)) into
	(subreg:A (truncate:C X) 0) instead of (truncate:A X).

	* gcc.dg/pr56494.c: New test.

From-SVN: r196451
parent 85f5dbea
2013-03-05 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/56494
* simplify-rtx.c (simplify_truncation): If C is narrower than A,
optimize (truncate:A (subreg:B (truncate:C X) 0)) into
(subreg:A (truncate:C X) 0) instead of (truncate:A X).
PR middle-end/56461
* sel-sched-ir.c (free_sched_pools): Release
succs_info_pool.stack[succs_info_pool.max_top] vectors too
......
......@@ -757,8 +757,17 @@ simplify_truncation (enum machine_mode mode, rtx op,
&& SCALAR_INT_MODE_P (GET_MODE (SUBREG_REG (op)))
&& GET_CODE (SUBREG_REG (op)) == TRUNCATE
&& subreg_lowpart_p (op))
return simplify_gen_unary (TRUNCATE, mode, XEXP (SUBREG_REG (op), 0),
GET_MODE (XEXP (SUBREG_REG (op), 0)));
{
rtx inner = XEXP (SUBREG_REG (op), 0);
if (GET_MODE_PRECISION (mode)
<= GET_MODE_PRECISION (GET_MODE (SUBREG_REG (op))))
return simplify_gen_unary (TRUNCATE, mode, inner, GET_MODE (inner));
else
/* If subreg above is paradoxical and C is narrower
than A, return (subreg:A (truncate:C X) 0). */
return simplify_gen_subreg (mode, SUBREG_REG (op),
GET_MODE (SUBREG_REG (op)), 0);
}
/* (truncate:A (truncate:B X)) is (truncate:A X). */
if (GET_CODE (op) == TRUNCATE)
......
2013-03-05 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/56494
* gcc.dg/pr56494.c: New test.
2013-01-04 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/pr56424.c: New test.
......
/* PR rtl-optimization/56494 */
/* { dg-do compile } */
/* { dg-options "-O2 -ftracer -w" } */
char a;
short b;
void bar (int);
void
foo (void)
{
bar ((!!b ? : (a *= a / 0)) >= (a = b));
}
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