@@ -1,5 +1,12 @@
2011-02-12 H.J. Lu <hongjiu.lu@intel.com>
+ PR target/47715
+ * config/i386/i386.md (*tls_global_dynamic_64): Remove DI on
+ operand 1.
+ (tls_global_dynamic_64): Likewise.
+
+2011-02-12 H.J. Lu <hongjiu.lu@intel.com>
+
* config/i386/i386.md (A): Moved.
2011-02-12 H.J. Lu <hongjiu.lu@intel.com>
@@ -12612,7 +12612,7 @@
[(set (match_operand:DI 0 "register_operand" "=a")
(call:DI (mem:QI (match_operand:DI 2 "call_insn_operand" ""))
(match_operand:DI 3 "" "")))
- (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")]
+ (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")]
UNSPEC_TLS_GD)]
"TARGET_64BIT"
{ return ASM_BYTE "0x66\n\tlea{q}\t{%a1@tlsgd(%%rip), %%rdi|rdi, %a1@tlsgd[rip]}\n" ASM_SHORT "0x6666\n\trex64\n\tcall\t%P2"; }
@@ -12622,7 +12622,7 @@
(define_expand "tls_global_dynamic_64"
[(parallel [(set (match_operand:DI 0 "register_operand" "")
(call:DI (mem:QI (match_dup 2)) (const_int 0)))
- (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")]
+ (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")]
UNSPEC_TLS_GD)])]
""
{
@@ -1,3 +1,9 @@
+2011-02-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/47715
+ * gcc.target/i386/pr47715-1.c: New.
+ * gcc.target/i386/pr47715-2.c: Likewise.
+
2011-02-08 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/47383
new file mode 100644
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+
+extern __thread int h_errno;
+int *
+__h_errno_location (void)
+{
+ return &h_errno;
+}
new file mode 100644
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+
+extern __thread int *__libc_resp;
+int
+__res_init(void) {
+ return *__libc_resp;
+}
Hi, x32 may generate both SI/DI symbol refereces in tls_global_dynamic_64 patterns. I checked in this patch to remove DI on operand 1. H.J. --- From f77aa55108b7b16106e1fea51b175f70b73d5ab9 Mon Sep 17 00:00:00 2001 From: H.J. Lu <hjl.tools@gmail.com> Date: Sat, 12 Feb 2011 17:10:24 -0800 Subject: [PATCH 2/2] Remove DI on operand 1 in tls_global_dynamic_64 patterns. --- gcc/ChangeLog.x32 | 7 +++++++ gcc/config/i386/i386.md | 4 ++-- gcc/testsuite/ChangeLog.x32 | 6 ++++++ gcc/testsuite/gcc.target/i386/pr47715-1.c | 10 ++++++++++ gcc/testsuite/gcc.target/i386/pr47715-2.c | 9 +++++++++ 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr47715-1.c create mode 100644 gcc/testsuite/gcc.target/i386/pr47715-2.c