re PR rtl-optimization/58295 (Missed zero-extension elimination in the combiner)

PR rtl-optimization/58295
	* simplify-rtx.c (simplify_truncation): Restrict the distribution for
	WORD_REGISTER_OPERATIONS targets.

From-SVN: r205874
This commit is contained in:
Eric Botcazou 2013-12-10 22:58:37 +00:00 committed by Eric Botcazou
parent 688974a346
commit 808c43038c
2 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2013-12-10 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/58295
* simplify-rtx.c (simplify_truncation): Restrict the distribution for
WORD_REGISTER_OPERATIONS targets.
2013-12-10 Richard Sandiford <rdsandiford@googlemail.com> 2013-12-10 Richard Sandiford <rdsandiford@googlemail.com>
* genrecog.c (validate_pattern): Treat all messages except missing * genrecog.c (validate_pattern): Treat all messages except missing

View File

@ -640,11 +640,16 @@ simplify_truncation (enum machine_mode mode, rtx op,
XEXP (op, 0), origmode); XEXP (op, 0), origmode);
} }
/* Simplify (truncate:SI (op:DI (x:DI) (y:DI))) /* If the machine can perform operations in the truncated mode, distribute
to (op:SI (truncate:SI (x:DI)) (truncate:SI (x:DI))). */ the truncation, i.e. simplify (truncate:QI (op:SI (x:SI) (y:SI))) into
if (GET_CODE (op) == PLUS (op:QI (truncate:QI (x:SI)) (truncate:QI (y:SI))). */
|| GET_CODE (op) == MINUS if (1
|| GET_CODE (op) == MULT) #ifdef WORD_REGISTER_OPERATIONS
&& precision >= BITS_PER_WORD
#endif
&& (GET_CODE (op) == PLUS
|| GET_CODE (op) == MINUS
|| GET_CODE (op) == MULT))
{ {
rtx op0 = simplify_gen_unary (TRUNCATE, mode, XEXP (op, 0), op_mode); rtx op0 = simplify_gen_unary (TRUNCATE, mode, XEXP (op, 0), op_mode);
if (op0) if (op0)