aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2016-09-28 12:27:41 +0200
committerClaudiu Zissulescu <claziss@synopsys.com>2016-10-06 17:01:59 +0200
commit08ec958fe088c7a226bb35bd2993254ff21228a3 (patch)
tree6af087d3b7f8bc4f79c85339c57cc80c086c6e03
parent7470adbb872d5363580eb5e0a8dbb231c286ee4c (diff)
downloadgdb-08ec958fe088c7a226bb35bd2993254ff21228a3.zip
gdb-08ec958fe088c7a226bb35bd2993254ff21228a3.tar.gz
gdb-08ec958fe088c7a226bb35bd2993254ff21228a3.tar.bz2
[ARC] Fix parsing leave_s and enter_s mnemonics.
gas/ 2016-10-06 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/leave_enter.d: New file. * testsuite/gas/arc/leave_enter.s: Likewise. * testsuite/gas/arc/regnames.d: Likewise. * testsuite/gas/arc/regnames.s: Likewise. * config/tc-arc.c (arc_parse_name): Don't match reg names against confirmed symbol names.
-rw-r--r--gas/ChangeLog9
-rw-r--r--gas/config/tc-arc.c3
-rw-r--r--gas/testsuite/gas/arc/leave_enter.d21
-rw-r--r--gas/testsuite/gas/arc/leave_enter.s16
-rw-r--r--gas/testsuite/gas/arc/regnames.d13
-rw-r--r--gas/testsuite/gas/arc/regnames.s8
6 files changed, 68 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index c88f70f..29b9cf6 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2016-10-06 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * testsuite/gas/arc/leave_enter.d: New file.
+ * testsuite/gas/arc/leave_enter.s: Likewise.
+ * testsuite/gas/arc/regnames.d: Likewise.
+ * testsuite/gas/arc/regnames.s: Likewise.
+ * config/tc-arc.c (arc_parse_name): Don't match reg names against
+ confirmed symbol names.
+
2016-10-06 Alan Modra <amodra@gmail.com>
* app.c (do_scrub_chars): Move fall through comment.
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index f28abf4..f18ed1b 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -3331,8 +3331,7 @@ arc_parse_name (const char *name,
if (!assembling_insn)
return FALSE;
- /* Handle only registers and address types. */
- if (e->X_op != O_absent)
+ if (e->X_op == O_symbol)
return FALSE;
sym = hash_find (arc_reg_hash, name);
diff --git a/gas/testsuite/gas/arc/leave_enter.d b/gas/testsuite/gas/arc/leave_enter.d
new file mode 100644
index 0000000..5eb1aef
--- /dev/null
+++ b/gas/testsuite/gas/arc/leave_enter.d
@@ -0,0 +1,21 @@
+#objdump: -dr
+
+.*: +file format .*arc.*
+
+
+Disassembly of section .text:
+
+[0-9a-f]+ <.text>:
+ 0: c0c2 leave_s \[r13-r13\]
+ 2: c4dc leave_s \[r13-gp,pcl\]
+ 4: c1dc leave_s \[r13-gp,fp\]
+ 6: c2dc leave_s \[r13-gp,blink\]
+ 8: c3dc leave_s \[r13-gp,fp,blink\]
+ a: c5dc leave_s \[r13-gp,fp,pcl\]
+ c: c6dc leave_s \[r13-gp,blink,pcl\]
+ e: c7dc leave_s \[r13-gp,fp,blink,pcl\]
+ 10: 1100 0000 ld r0,\[r1\]
+ 14: c0e2 enter_s \[r13-r13\]
+ 16: c1fc enter_s \[r13-gp,fp\]
+ 18: c2fc enter_s \[r13-gp,blink\]
+ 1a: c3fc enter_s \[r13-gp,fp,blink\]
diff --git a/gas/testsuite/gas/arc/leave_enter.s b/gas/testsuite/gas/arc/leave_enter.s
new file mode 100644
index 0000000..1bdcc06
--- /dev/null
+++ b/gas/testsuite/gas/arc/leave_enter.s
@@ -0,0 +1,16 @@
+ .cpu HS
+ leave_s {r13-r13}
+ leave_s {r13-r26,pcl}
+ leave_s {r13-r26,fp}
+ leave_s {r13-r26,blink}
+ leave_s {r13-r26,fp,blink}
+ leave_s {r13-r26,fp,pcl}
+ leave_s {r13-r26,blink,pcl}
+ leave_s {r13-r26,fp,blink,pcl}
+
+ ld r0,[r1]
+
+ enter_s {r13-r13}
+ enter_s {r13-r26,fp}
+ enter_s {r13-r26,blink}
+ enter_s {r13-r26,fp,blink}
diff --git a/gas/testsuite/gas/arc/regnames.d b/gas/testsuite/gas/arc/regnames.d
new file mode 100644
index 0000000..5928a5e
--- /dev/null
+++ b/gas/testsuite/gas/arc/regnames.d
@@ -0,0 +1,13 @@
+#objdump: -dr
+
+.*: +file format .*arc.*
+
+
+Disassembly of section .text:
+
+[0-9a-f]+ <r0>:
+ 0: 200a 0f80 0000 0014 mov r0,0x14
+ 8: 2000 0f80 0000 0000 add r0,r0,0
+ c: R_ARC_32_ME gp
+ 10: 1a00 3080 st r2,\[gp\]
+ 10: R_ARC_SDA_LDST .text\+0x14
diff --git a/gas/testsuite/gas/arc/regnames.s b/gas/testsuite/gas/arc/regnames.s
new file mode 100644
index 0000000..aaea270
--- /dev/null
+++ b/gas/testsuite/gas/arc/regnames.s
@@ -0,0 +1,8 @@
+;;; Check if assembler can discriminate between labels having the same
+;;; name as a register
+
+r0:
+ mov r0,@r1-@r0
+ add r0,r0,@gp
+ st r2,[gp,@r1@sda]
+r1: