aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2013-11-04 16:05:39 +0100
committerJan Beulich <jbeulich@suse.com>2013-11-04 16:05:39 +0100
commite4630f71b252fa13df07f93d427e7c9f4505c1fe (patch)
tree82275c36ca7e86c47697c7e604eac1720a541f1f /gas
parent67c059c29e1fb0cdeacdd2005f955514d8d1fb34 (diff)
downloadgdb-e4630f71b252fa13df07f93d427e7c9f4505c1fe.zip
gdb-e4630f71b252fa13df07f93d427e7c9f4505c1fe.tar.gz
gdb-e4630f71b252fa13df07f93d427e7c9f4505c1fe.tar.bz2
x86-64/gas: fix an asymmetry in suffix/register checking
Without this, constructs like "orw %rax, (%rax)" aren't being rejected (other than any other wrong suffix/register combination). gas/ 2013-11-04 Jan Beulich <jbeulich@suse.com> * config/tc-i386.c (check_long_reg): Correct comment indentation. (check_qword_reg): Correct comment and its indentation. (check_word_reg): Extend comment and correct its indentation. Also check for 64-bit register. gas/testsuite/ 2013-11-04 Jan Beulich <jbeulich@suse.com> * gas/i386/x86-64-suffix-bad.[sl]: New. * gas/i386/i386.exp: Run new test.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-i386.c11
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/i386/i386.exp1
-rw-r--r--gas/testsuite/gas/i386/x86-64-suffix-bad.l13
-rw-r--r--gas/testsuite/gas/i386/x86-64-suffix-bad.s17
6 files changed, 49 insertions, 5 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 88f5f91..b5202e0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2013-11-04 Jan Beulich <jbeulich@suse.com>
+
+ * config/tc-i386.c (check_long_reg): Correct comment indentation.
+ (check_qword_reg): Correct comment and its indentation.
+ (check_word_reg): Extend comment and correct its indentation. Also
+ check for 64-bit register.
+
2013-10-30 Ulrich Weigand <uweigand@de.ibm.com>
* config/tc-ppc.c (md_pseudo_table): Add .localentry.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 32f6d48..973ebe4 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -5418,7 +5418,7 @@ check_long_reg (void)
i.suffix);
return 0;
}
- /* Warn if the e prefix on a general reg is missing. */
+ /* Warn if the e prefix on a general reg is missing. */
else if ((!quiet_warnings || flag_code == CODE_64BIT)
&& i.types[op].bitfield.reg16
&& (i.tm.operand_types[op].bitfield.reg32
@@ -5440,7 +5440,7 @@ check_long_reg (void)
register_prefix, i.op[op].regs->reg_name, i.suffix);
#endif
}
- /* Warn if the r prefix on a general reg is missing. */
+ /* Warn if the r prefix on a general reg is present. */
else if (i.types[op].bitfield.reg64
&& (i.tm.operand_types[op].bitfield.reg32
|| i.tm.operand_types[op].bitfield.acc))
@@ -5483,7 +5483,7 @@ check_qword_reg (void)
i.suffix);
return 0;
}
- /* Warn if the e prefix on a general reg is missing. */
+ /* Warn if the r prefix on a general reg is missing. */
else if ((i.types[op].bitfield.reg16
|| i.types[op].bitfield.reg32)
&& (i.tm.operand_types[op].bitfield.reg32
@@ -5528,9 +5528,10 @@ check_word_reg (void)
i.suffix);
return 0;
}
- /* Warn if the e prefix on a general reg is present. */
+ /* Warn if the e or r prefix on a general reg is present. */
else if ((!quiet_warnings || flag_code == CODE_64BIT)
- && i.types[op].bitfield.reg32
+ && (i.types[op].bitfield.reg32
+ || i.types[op].bitfield.reg64)
&& (i.tm.operand_types[op].bitfield.reg16
|| i.tm.operand_types[op].bitfield.acc))
{
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 9694b8a..1d01b33 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-04 Jan Beulich <jbeulich@suse.com>
+
+ * gas/i386/x86-64-suffix-bad.[sl]: New.
+ * gas/i386/i386.exp: Run new test.
+
2013-11-02 Alan Modra <amodra@gmail.com>
* gas/cfi/cfi-x86_64.d: Match when lacking end of section padding.
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index e0589e4..ce77fef 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -444,6 +444,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_dump_test "x86-64-disp32"
run_dump_test "rexw"
run_list_test "x86-64-specific-reg"
+ run_list_test "x86-64-suffix-bad"
run_dump_test "x86-64-fxsave"
run_dump_test "x86-64-fxsave-intel"
run_dump_test "x86-64-arch-1"
diff --git a/gas/testsuite/gas/i386/x86-64-suffix-bad.l b/gas/testsuite/gas/i386/x86-64-suffix-bad.l
new file mode 100644
index 0000000..febdc0c
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-suffix-bad.l
@@ -0,0 +1,13 @@
+.*: Assembler messages:
+.*:3: Error: .*
+.*:4: Error: .*
+.*:5: Error: .*
+.*:7: Error: .*
+.*:8: Error: .*
+.*:9: Error: .*
+.*:11: Error: .*
+.*:12: Error: .*
+.*:13: Error: .*
+.*:15: Error: .*
+.*:16: Error: .*
+.*:17: Error: .*
diff --git a/gas/testsuite/gas/i386/x86-64-suffix-bad.s b/gas/testsuite/gas/i386/x86-64-suffix-bad.s
new file mode 100644
index 0000000..c4462f6
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-suffix-bad.s
@@ -0,0 +1,17 @@
+ .text
+start:
+ orw %al, (%rax)
+ orl %al, (%rax)
+ orq %al, (%rax)
+
+ orb %ax, (%rax)
+ orl %ax, (%rax)
+ orq %ax, (%rax)
+
+ orb %eax, (%rax)
+ orw %eax, (%rax)
+ orq %eax, (%rax)
+
+ orb %rax, (%rax)
+ orw %rax, (%rax)
+ orl %rax, (%rax)