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.
This commit is contained in:
Alan Modra
2018-10-20 11:12:46 +10:30
parent ac85e67c05
commit e4c2619ad1
6 changed files with 55 additions and 1 deletions

View File

@@ -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))