aboutsummaryrefslogtreecommitdiff
path: root/gas/expr.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-09-20 00:58:39 +0000
committerAlan Modra <amodra@gmail.com>2002-09-20 00:58:39 +0000
commitf6cf69d7004da45c2a12f10e3b78290c6f40a13c (patch)
tree079d22108f58daac6421a98f3419b0d356563590 /gas/expr.c
parentdea97812277d4b545fce15c857925c2997f4fd47 (diff)
downloadgdb-f6cf69d7004da45c2a12f10e3b78290c6f40a13c.zip
gdb-f6cf69d7004da45c2a12f10e3b78290c6f40a13c.tar.gz
gdb-f6cf69d7004da45c2a12f10e3b78290c6f40a13c.tar.bz2
* expr.c (expr): Simplify foo-foo here.
(clean_up_expression): Remove O_subtract code.
Diffstat (limited to 'gas/expr.c')
-rw-r--r--gas/expr.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/gas/expr.c b/gas/expr.c
index b8e49f5..68c4a78 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1347,8 +1347,6 @@ operand (expressionP)
Elsewise we waste time special-case testing. Sigh. Ditto SEG_ABSENT.
Out: expressionS may have been modified:
- 'foo-foo' symbol references cancelled to 0, which changes X_op
- from O_subtract to O_constant.
Unused fields zeroed to help expr (). */
static void
@@ -1371,21 +1369,6 @@ clean_up_expression (expressionP)
case O_bit_not:
expressionP->X_op_symbol = NULL;
break;
- case O_subtract:
- if (expressionP->X_op_symbol == expressionP->X_add_symbol
- || ((symbol_get_frag (expressionP->X_op_symbol)
- == symbol_get_frag (expressionP->X_add_symbol))
- && SEG_NORMAL (S_GET_SEGMENT (expressionP->X_add_symbol))))
- {
- addressT diff = (S_GET_VALUE (expressionP->X_add_symbol)
- - S_GET_VALUE (expressionP->X_op_symbol));
-
- expressionP->X_op = O_constant;
- expressionP->X_add_symbol = NULL;
- expressionP->X_op_symbol = NULL;
- expressionP->X_add_number += diff;
- }
- break;
default:
break;
}
@@ -1751,7 +1734,8 @@ expr (rankarg, resultP)
&& resultP->X_op == O_symbol
&& (symbol_get_frag (right.X_add_symbol)
== symbol_get_frag (resultP->X_add_symbol))
- && SEG_NORMAL (rightseg))
+ && (SEG_NORMAL (rightseg)
+ || right.X_add_symbol == resultP->X_add_symbol))
{
resultP->X_add_number -= right.X_add_number;
resultP->X_add_number += (S_GET_VALUE (resultP->X_add_symbol)