diff options
author | Alan Modra <amodra@gmail.com> | 2018-10-20 11:12:46 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-10-20 19:46:43 +1030 |
commit | e4c2619ad1f31cf73d275b027e8c0cf9c6e9597a (patch) | |
tree | 1b93a048c0c8e91a12c2841df06446689da1c61d /gas/expr.c | |
parent | ac85e67c053f1555def2c111962f4e68740794f9 (diff) | |
download | gdb-e4c2619ad1f31cf73d275b027e8c0cf9c6e9597a.zip gdb-e4c2619ad1f31cf73d275b027e8c0cf9c6e9597a.tar.gz gdb-e4c2619ad1f31cf73d275b027e8c0cf9c6e9597a.tar.bz2 |
PR23800, .eqv doesn't always defer expression evaluation
.eqv (and ==) ought not simplify expressions involving dot or other
symbols set by .eqv. If such simplification occurs, the value of dot
will be that at the assignment rather than at the place where the
symbol is used.
PR 23800
* expr.c (expr): Don't simplify expressions involving forward_ref
symbols when mode is expr_defer.
* config/tc-spu.c (spu_cons): Parse expression using normal
expression evaluation if @ppu is not detected.
* testsuite/gas/all/eqv-dot.d,
* testsuite/gas/all/eqv-dot.s: New test.
* testsuite/gas/all/gas.exp: Run it.
Diffstat (limited to 'gas/expr.c')
-rw-r--r-- | gas/expr.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1838,6 +1838,13 @@ expr (int rankarg, /* Larger # is higher rank. */ right.X_op_symbol = NULL; } + if (mode == expr_defer + && ((resultP->X_add_symbol != NULL + && S_IS_FORWARD_REF (resultP->X_add_symbol)) + || (right.X_add_symbol != NULL + && S_IS_FORWARD_REF (right.X_add_symbol)))) + goto general; + /* Optimize common cases. */ #ifdef md_optimize_expr if (md_optimize_expr (resultP, op_left, &right)) |