fold-const.c (fold): Guard (-A)+B -> B-A transformation with reorder_operands_p.
* fold-const.c (fold) <PLUS_EXPR>: Guard (-A)+B -> B-A transformation with reorder_operands_p. From-SVN: r80381
This commit is contained in:
parent
ef1140a912
commit
2f63a4570c
2 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-04-03 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
* fold-const.c (fold) <PLUS_EXPR>: Guard (-A)+B -> B-A transformation
|
||||
with reorder_operands_p.
|
||||
|
||||
2004-04-03 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* md.texi (vec_set, vec_extract, vec_init): Document.
|
||||
|
|
|
@ -5861,9 +5861,10 @@ fold (tree expr)
|
|||
if (TREE_CODE (arg1) == NEGATE_EXPR)
|
||||
return fold (build (MINUS_EXPR, type, arg0, TREE_OPERAND (arg1, 0)));
|
||||
/* (-A) + B -> B - A */
|
||||
if (TREE_CODE (arg0) == NEGATE_EXPR)
|
||||
if (TREE_CODE (arg0) == NEGATE_EXPR
|
||||
&& reorder_operands_p (TREE_OPERAND (arg0, 0), arg1))
|
||||
return fold (build (MINUS_EXPR, type, arg1, TREE_OPERAND (arg0, 0)));
|
||||
else if (! FLOAT_TYPE_P (type))
|
||||
if (! FLOAT_TYPE_P (type))
|
||||
{
|
||||
if (integer_zerop (arg1))
|
||||
return non_lvalue (fold_convert (type, arg0));
|
||||
|
|
Loading…
Add table
Reference in a new issue