aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@codesourcery.com>2007-07-01 21:15:14 +0000
committerDaniel Jacobowitz <drow@gcc.gnu.org>2007-07-01 21:15:14 +0000
commit10ae7c7b78beed4a5d924ec89371ecb0b0a9a367 (patch)
tree69a4c8dfbaa4c8ec2fe6ddfd5115e39d98bc15f1
parentaf92ab368ad709fcd26b360dc1cf4e50b0cd6185 (diff)
downloadgcc-10ae7c7b78beed4a5d924ec89371ecb0b0a9a367.zip
gcc-10ae7c7b78beed4a5d924ec89371ecb0b0a9a367.tar.gz
gcc-10ae7c7b78beed4a5d924ec89371ecb0b0a9a367.tar.bz2
arm.c (arm_cannot_copy_insn_p): Do not expect a PARALLEL.
* config/arm/arm.c (arm_cannot_copy_insn_p): Do not expect a PARALLEL. * config/arm/arm.md (pic_add_dot_plus_four, pic_add_dot_plus_eight) (tls_load_dot_plus_eight): Move the label number into the unspec. * config/arm/thumb2.md (pic_load_dot_plus_four): Likewise. * gcc.dg/tls/opt-14.c: New. From-SVN: r126178
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/arm/arm.c5
-rw-r--r--gcc/config/arm/arm.md18
-rw-r--r--gcc/config/arm/thumb2.md6
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/tls/opt-14.c28
6 files changed, 54 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 96c4582..295dc72 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2007-07-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * config/arm/arm.c (arm_cannot_copy_insn_p): Do not expect a
+ PARALLEL.
+ * config/arm/arm.md (pic_add_dot_plus_four, pic_add_dot_plus_eight)
+ (tls_load_dot_plus_eight): Move the label number into the unspec.
+ * config/arm/thumb2.md (pic_load_dot_plus_four): Likewise.
+
2007-07-01 Andreas Schwab <schwab@suse.de>
* dwarf2out.c (initial_return_save): Define only if used.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 7cd2cad..df08c46 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -6058,10 +6058,9 @@ arm_cannot_copy_insn_p (rtx insn)
{
rtx pat = PATTERN (insn);
- if (GET_CODE (pat) == PARALLEL
- && GET_CODE (XVECEXP (pat, 0, 0)) == SET)
+ if (GET_CODE (pat) == SET)
{
- rtx rhs = SET_SRC (XVECEXP (pat, 0, 0));
+ rtx rhs = SET_SRC (pat);
if (GET_CODE (rhs) == UNSPEC
&& XINT (rhs, 1) == UNSPEC_PIC_BASE)
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 5a8774e..fca66d8 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -4859,9 +4859,9 @@
(define_insn "pic_add_dot_plus_four"
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(plus:SI (match_operand:SI 1 "register_operand" "0")
- (const (plus:SI (pc) (const_int 4))))]
- UNSPEC_PIC_BASE))
- (use (match_operand 2 "" ""))]
+ (const (plus:SI (pc) (const_int 4))))
+ (match_operand 2 "" "")]
+ UNSPEC_PIC_BASE))]
"TARGET_THUMB1"
"*
(*targetm.asm_out.internal_label) (asm_out_file, \"LPIC\",
@@ -4874,9 +4874,9 @@
(define_insn "pic_add_dot_plus_eight"
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(plus:SI (match_operand:SI 1 "register_operand" "r")
- (const (plus:SI (pc) (const_int 8))))]
- UNSPEC_PIC_BASE))
- (use (match_operand 2 "" ""))]
+ (const (plus:SI (pc) (const_int 8))))
+ (match_operand 2 "" "")]
+ UNSPEC_PIC_BASE))]
"TARGET_ARM"
"*
(*targetm.asm_out.internal_label) (asm_out_file, \"LPIC\",
@@ -4889,9 +4889,9 @@
(define_insn "tls_load_dot_plus_eight"
[(set (match_operand:SI 0 "register_operand" "+r")
(mem:SI (unspec:SI [(plus:SI (match_operand:SI 1 "register_operand" "r")
- (const (plus:SI (pc) (const_int 8))))]
- UNSPEC_PIC_BASE)))
- (use (match_operand 2 "" ""))]
+ (const (plus:SI (pc) (const_int 8))))
+ (match_operand 2 "" "")]
+ UNSPEC_PIC_BASE)))]
"TARGET_ARM"
"*
(*targetm.asm_out.internal_label) (asm_out_file, \"LPIC\",
diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 685da30..fe2f874 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -259,9 +259,9 @@
;; word aligned.
(define_insn "pic_load_dot_plus_four"
[(set (match_operand:SI 0 "register_operand" "=r")
- (unspec:SI [(const (plus:SI (pc) (const_int 4)))]
- UNSPEC_PIC_BASE))
- (use (match_operand 1 "" ""))]
+ (unspec:SI [(const (plus:SI (pc) (const_int 4)))
+ (use (match_operand 1 "" ""))]
+ UNSPEC_PIC_BASE))]
"TARGET_THUMB2"
"*
assemble_align(BITS_PER_WORD);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5b390d3..6c58ee5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2007-07-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gcc.dg/tls/opt-14.c: New.
+
2007-07-01 Ollie Wild <aaw@google.com>
* g++.dg/lookup/using16.C: New test.
diff --git a/gcc/testsuite/gcc.dg/tls/opt-14.c b/gcc/testsuite/gcc.dg/tls/opt-14.c
new file mode 100644
index 0000000..5abeace
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/opt-14.c
@@ -0,0 +1,28 @@
+/* This testcase generated invalid assembly on ARM Thumb-2. Two
+ PIC additions of pc were combined, but the deleted label was still
+ used. */
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
+
+struct __res_state
+{
+ int options;
+};
+extern __thread struct __res_state *__resp
+ __attribute__ ((tls_model ("initial-exec")));
+
+void foo (void);
+
+int main(void)
+{
+ int count, total = 0;
+
+ for (count = 0; count < 10; count++)
+ {
+ if (((*__resp).options & 0x00000001) == 0)
+ foo ();
+ (*__resp).options &= ~((0x00000002 | 0x00000200 | 0x00000080));
+ }
+ return 0;
+}