aboutsummaryrefslogtreecommitdiff
path: root/gas/config/bfin-parse.y
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2006-09-18 20:13:23 +0000
committerBernd Schmidt <bernds@codesourcery.com>2006-09-18 20:13:23 +0000
commit7333257119adc9883f90bf5ae1652001f4abf63d (patch)
treecfdee94a48e2354762cdd471480560b3c27a7c80 /gas/config/bfin-parse.y
parent3b7882616d040dc544f908f13a086c1a9b3f738b (diff)
downloadgdb-7333257119adc9883f90bf5ae1652001f4abf63d.zip
gdb-7333257119adc9883f90bf5ae1652001f4abf63d.tar.gz
gdb-7333257119adc9883f90bf5ae1652001f4abf63d.tar.bz2
* config/bfin-parse.y (binary): Change sub of const to add of negated
const.
Diffstat (limited to 'gas/config/bfin-parse.y')
-rw-r--r--gas/config/bfin-parse.y6
1 files changed, 6 insertions, 0 deletions
diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y
index f74074e..b3416aa 100644
--- a/gas/config/bfin-parse.y
+++ b/gas/config/bfin-parse.y
@@ -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)
{