aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-12-15 10:21:51 +0000
committerNick Clifton <nickc@redhat.com>2011-12-15 10:21:51 +0000
commit5011093dd0015bc0eaff522b4e0a18250725d4b4 (patch)
treeda04ec25c27553e8690c4029cb23fea59cdb2f9c /gas
parent370a075d4837b62334a012279faaa95cf8028f51 (diff)
downloadgdb-5011093dd0015bc0eaff522b4e0a18250725d4b4.zip
gdb-5011093dd0015bc0eaff522b4e0a18250725d4b4.tar.gz
gdb-5011093dd0015bc0eaff522b4e0a18250725d4b4.tar.bz2
* frv.opc (parse_uhi16): Fix handling of %hi operator on 64-bit
hosts. * cgen-asm.c (cgen_parse_signed_integer): Add code to handle the sign extension of negative values on a 64-bit host. * frv-asm.c: Regenerate. * gas/frv/immediates.s: New test file - checks assembly of constant values. * gas/frv/immediates.d: Expected disassmbly. * gas/frv/allinsn.exp: Run the new test.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-arm.c11
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/frv/allinsn.exp2
-rw-r--r--gas/testsuite/gas/frv/immediates.d12
-rw-r--r--gas/testsuite/gas/frv/immediates.s9
5 files changed, 38 insertions, 3 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index a73f01a..865f430 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -3540,6 +3540,7 @@ s_arm_unwind_fnend (int ignored ATTRIBUTE_UNUSED)
record_alignment (now_seg, 2);
ptr = frag_more (8);
+ memset (ptr, 0, 8);
where = frag_now_fix () - 8;
/* Self relative offset of the function start. */
@@ -19926,8 +19927,12 @@ create_unwind_entry (int have_data)
size = unwind.opcode_count - 2;
}
else
- /* An extra byte is required for the opcode count. */
- size = unwind.opcode_count + 1;
+ {
+ gas_assert (unwind.personality_index == -1);
+
+ /* An extra byte is required for the opcode count. */
+ size = unwind.opcode_count + 1;
+ }
size = (size + 3) >> 2;
if (size > 0xff)
@@ -19953,7 +19958,7 @@ create_unwind_entry (int have_data)
ptr += 4;
/* Set the first byte to the number of additional words. */
- data = size - 1;
+ data = size > 0 ? size - 1 : 0;
n = 3;
break;
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 939d56a..5fa4335 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2011-12-15 Nick Clifton <nickc@redhat.com>
+
+ * gas/frv/immediates.s: New test file - checks assembly of
+ constant values.
+ * gas/frv/immediates.d: Expected disassembly.
+ * gas/frv/allinsn.exp: Run the new test.
+
2011-12-14 Stuart Henderson <shenders@gcc.gnu.org>
* gas/bfin/move.d: Update SRCx field expectations.
diff --git a/gas/testsuite/gas/frv/allinsn.exp b/gas/testsuite/gas/frv/allinsn.exp
index b6950ae..4796b8a 100644
--- a/gas/testsuite/gas/frv/allinsn.exp
+++ b/gas/testsuite/gas/frv/allinsn.exp
@@ -17,4 +17,6 @@ if [istarget frv*-*-*] {
run_list_test "fr450-media-issue" "-mcpu=fr450"
run_dump_test "fr550-pack1"
+
+ run_dump_test "immediates"
}
diff --git a/gas/testsuite/gas/frv/immediates.d b/gas/testsuite/gas/frv/immediates.d
new file mode 100644
index 0000000..7ac8c40
--- /dev/null
+++ b/gas/testsuite/gas/frv/immediates.d
@@ -0,0 +1,12 @@
+#as:
+#objdump: -d
+#name: Parsing immediate values
+
+.*: +file format .*
+
+Disassembly of section \.text:
+
+00000000 <foo>:
+ 0:[ ]+86 fc e0 00[ ]+setlos 0xff+e000,gr3
+ 4:[ ]+08 f8 3f ff[ ]+sethi.p 0x3fff,gr4
+
diff --git a/gas/testsuite/gas/frv/immediates.s b/gas/testsuite/gas/frv/immediates.s
new file mode 100644
index 0000000..d3fe668
--- /dev/null
+++ b/gas/testsuite/gas/frv/immediates.s
@@ -0,0 +1,9 @@
+ ;; These instructions can be found in the FRV Linux kernel.
+ ;; They used to fail to assemble on 64-bit host machines
+ ;; because of sign-extension problems.
+
+ .text
+ .global foo
+foo:
+ setlos #0xffffe000, gr3
+ sethi.p %hi(~(0x80000000 | 0x40000000)), gr4