This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Fix mips_ip for correct error message
- From: "Fu, Chao-Ying" <fu at mips dot com>
- To: <binutils at sourceware dot org>
- Date: Mon, 14 Jul 2008 15:32:39 -0700
- Subject: Fix mips_ip for correct error message
Hello,
In "mips_ip", the error handling code forgets to reset s to argsStart,
such that the instruction string is incomplete. Please check the
attached patch. Also, due to the fix, two ".l" tests need to be
updated.
Is this patch ok? Thanks a lot!
Regards
Chao-ying
gas/ChangeLog
2008-07-14 Chao-ying Fu <fu@mips.com>
* config/tc-mips.c (mips_ip): Reset s to argsStart.
gas/testsuite/ChangeLog
2008-07-14 Chao-ying Fu <fu@mips.com>
* gas/mips/tls-ill.l: Update error message.
* gas/mips/octeon-ill.l: Likewise.
Index: tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.390
diff -u -p -r1.390 tc-mips.c
--- tc-mips.c 10 Jul 2008 19:05:29 -0000 1.390
+++ tc-mips.c 14 Jul 2008 22:23:01 -0000
@@ -9958,7 +9958,10 @@ do_msbd:
continue;
}
if (save_c)
- *(--s) = save_c;
+ {
+ s = argsStart;
+ *(--s) = save_c;
+ }
insn_error = _("illegal operands");
return;
}
Index: testsuite/gas/mips/tls-ill.l
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/tls-ill.l,v
retrieving revision 1.1
diff -u -p -r1.1 tls-ill.l
--- testsuite/gas/mips/tls-ill.l 2 Mar 2005 21:22:47 -0000 1.1
+++ testsuite/gas/mips/tls-ill.l 14 Jul 2008 22:23:49 -0000
@@ -1,11 +1,11 @@
.*: Assembler messages:
.*:6: Error: bad expression
-.*:6: Error: illegal operands `addiu'
+.*:6: Error: illegal operands `addiu \$4,\$28,%dtprel\(tlsvar\)'
.*:7: Error: bad expression
-.*:7: Error: illegal operands `addiu'
+.*:7: Error: illegal operands `addiu \$4,\$28,%tprel\(tlsvar\)'
.*:8: Error: bad expression
.*:8: Error: missing '\)'
-.*:8: Error: illegal operands `addiu'
+.*:8: Error: illegal operands `addiu \$4,\$28,%lo\(%gottprel\(tlsvar\)\)'
.*:9: Error: bad expression
.*:9: Error: missing '\)'
-.*:9: Error: illegal operands `addiu'
+.*:9: Error: illegal operands `addiu \$4,\$28,%hi\(%gottprel\(tlsvar\)\)'
Index: testsuite/gas/mips/octeon-ill.l
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/octeon-ill.l,v
retrieving revision 1.3
diff -u -p -r1.3 octeon-ill.l
--- testsuite/gas/mips/octeon-ill.l 7 Jul 2008 19:28:02 -0000 1.3
+++ testsuite/gas/mips/octeon-ill.l 14 Jul 2008 22:23:49 -0000
@@ -31,9 +31,9 @@
.*:45: Error: expression out of range
.*:46: Error: expression out of range
.*:47: Error: register value used as expression
-.*:48: Error: illegal operands `dmfc2'
+.*:48: Error: illegal operands `dmfc2 \$4,\$15,4'
.*:49: Error: register value used as expression
-.*:50: Error: illegal operands `dmtc2'
+.*:50: Error: illegal operands `dmtc2 \$22,\$7,\$4'
.*:52: Error: Improper size \(32\)
.*:54: Error: Improper position \(32\)
.*:55: Error: Improper size \(29\)