+2018-10-20 Alan Modra <amodra@gmail.com>
+
+ 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.
+
2018-10-19 Tamar Christina <tamar.christina@arm.com>
* testsuite/gas/arm/undefined-insn-arm.d: Widen pe skip.
do
{
+ char *save = input_line_pointer;
+
+ /* Use deferred_expression here so that an expression involving
+ a symbol that happens to be defined already as an spu symbol,
+ is not resolved. */
deferred_expression (&exp);
if ((exp.X_op == O_symbol
|| exp.X_op == O_constant)
{
expressionS new_exp;
+ save = input_line_pointer;
expression (&new_exp);
if (new_exp.X_op == O_constant)
exp.X_add_number += new_exp.X_add_number;
+ else
+ input_line_pointer = save;
}
reloc = nbytes == 4 ? BFD_RELOC_SPU_PPU32 : BFD_RELOC_SPU_PPU64;
&exp, 0, reloc);
}
else
- emit_expr (&exp, nbytes);
+ {
+ /* Don't use deferred_expression for anything else.
+ deferred_expression won't evaulate dot at the point it is
+ used. */
+ input_line_pointer = save;
+ expression (&exp);
+ emit_expr (&exp, nbytes);
+ }
}
while (*input_line_pointer++ == ',');
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))
--- /dev/null
+#objdump: -s -j .data
+#name: eqv involving dot
+# bfin doesn't support 'symbol = expression'
+# tic4x has 4 octets per byte
+#notarget: bfin-*-* tic4x-*-*
+
+.*: .*
+
+Contents of section \.data:
+ 0000 (0+00 0+01 0+02 0+0c|000+ 010+ 020+ 0c0+) .*
+ 0010 (0+10 0+14 0+10 0+1c|100+ 140+ 100+ 1c0+) .*
+#pass
--- /dev/null
+ .data
+x: .long 0, 1, 2, . - x
+ y = . - x
+ z == . - x
+ .long y
+ .long z
+ .long y
+ .long z
gas_test "eqv-ok.s" "" "" ".eqv support"
gas_test_error "eqv-bad.s" "" ".eqv for symbol already set"
+run_dump_test eqv-dot
if { ![istarget "bfin-*-*"] } then {
gas_test "assign-ok.s" "" "" "== assignment support"