x86: correctly handle KMOVD with VEX.W set outside of 64-bit mode
[binutils-gdb.git] / gas / expr.c
index 074e0b3f0b5a93f29c79a77a2404946383f725db..bacfa4e9e8220c9dd72a70267a08712de303d31f 100644 (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))