* config/bfin-parse.y (binary): Change sub of const to add of negated
authorBernd Schmidt <bernds@codesourcery.com>
Mon, 18 Sep 2006 20:13:23 +0000 (20:13 +0000)
committerBernd Schmidt <bernds@codesourcery.com>
Mon, 18 Sep 2006 20:13:23 +0000 (20:13 +0000)
const.

gas/ChangeLog
gas/config/bfin-parse.y

index 64b3470c5dfcfaadc85923f7a707d693cb28e098..1b939edd52c5b486bbde1201d976564fb8ac7cb9 100644 (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.
index f74074e55a1b4c0279137a5ef40e2ba66af2c289..b3416aa1130a7a7e2aedb71256843070cc1a664a 100644 (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)
     {