diff options
author | Alan Modra <amodra@gmail.com> | 2002-09-20 00:58:39 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-09-20 00:58:39 +0000 |
commit | f6cf69d7004da45c2a12f10e3b78290c6f40a13c (patch) | |
tree | 079d22108f58daac6421a98f3419b0d356563590 /gas/expr.c | |
parent | dea97812277d4b545fce15c857925c2997f4fd47 (diff) | |
download | gdb-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.c | 20 |
1 files changed, 2 insertions, 18 deletions
@@ -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) |