+2020-02-XX Jan Beulich <jbeulich@suse.com>
+
+ * config/tc-i386.c (process_operands): Also check insn prefix
+ for ineffectual segment override warning. Don't cover possible
+ VEX/EVEX encoded insns there.
+ * testsuite/gas/i386/lea.s, testsuite/gas/i386/lea.d,
+ testsuite/gas/i386/lea.e: New.
+ * testsuite/gas/i386/i386.exp: Run new test.
+
2020-02-14 H.J. Lu <hongjiu.lu@intel.com>
PR gas/25438
}
}
- if (i.tm.base_opcode == 0x8d /* lea */
- && i.seg[0]
- && !quiet_warnings)
+ if ((i.seg[0] || i.prefix[SEG_PREFIX])
+ && !quiet_warnings
+ && i.tm.base_opcode == 0x8d /* lea */
+ && !is_any_vex_encoding(&i.tm))
as_warn (_("segment override on `%s' is ineffectual"), i.tm.name);
/* If a segment was explicitly specified, and the specified segment
run_dump_test "intelok"
run_dump_test "prefix"
run_list_test "prefix32" "-al"
+ run_dump_test "lea"
run_dump_test "amd"
run_dump_test "katmai"
run_dump_test "jump"
--- /dev/null
+#objdump: -dw
+#name: i386 LEA-like warnings
+#warning_output: lea.e
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <start>:
+[ ]*[0-9a-f]+:[ ]+36 8d 00[ ]+lea[ ]+%ss:\(%eax\),%eax
+[ ]*[0-9a-f]+:[ ]+36 8d 00[ ]+lea[ ]+%ss:\(%eax\),%eax
+#pass
--- /dev/null
+.*: Assembler messages:
+.*:3: Warning: .* `lea' .*
+.*:4: Warning: .* `lea' .*
--- /dev/null
+ .text
+start:
+ lea %ss:(%eax), %eax
+ ss lea (%eax), %eax