* config/bfin-parse.y (binary): Change sub of const to add of negated

const.
This commit is contained in:
Bernd Schmidt 2006-09-18 20:13:23 +00:00
parent 3b7882616d
commit 7333257119
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2006-09-18 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin-parse.y (binary): Change sub of const to add of negated
const.
2006-09-17 Mei Ligang <ligang@sunnorth.com.cn>
* config/tc-score.c: New file.

View File

@ -4328,6 +4328,12 @@ binary (Expr_Op_Type op, Expr_Node *x, Expr_Node *y)
x = y;
y = t;
}
/* Canonicalize subtraction of const to addition of negated const. */
if (op == Expr_Op_Type_Sub && y->type == Expr_Node_Constant)
{
op = Expr_Op_Type_Add;
y->value.i_value = -y->value.i_value;
}
if (y->type == Expr_Node_Constant && x->type == Expr_Node_Binop
&& x->Right_Child->type == Expr_Node_Constant)
{