Patchwork [x32] PATCH: PR target/47446: [x32] .quad instead of .long is used for address

login
register
mail settings
Submitter H.J. Lu
Date Jan. 24, 2011, 9:08 p.m.
Message ID <20110124210853.GA1460@intel.com>
Download mbox | patch
Permalink /patch/80244/
State New
Headers show

Comments

H.J. Lu - Jan. 24, 2011, 9:08 p.m.
Hi,

I checked this patch into x32 branch.

H.J.
---
commit e9a73ee31b8b78d42edf177690054c2cac8ddf33
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Jan 24 13:06:15 2011 -0800

    Check TARGET_LP64 instead of TARGET_64BIT for ASM_QUAD.

Patch

diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32
index fb3e3e0..ebe1d13 100644
--- a/gcc/ChangeLog.x32
+++ b/gcc/ChangeLog.x32
@@ -1,3 +1,10 @@ 
+2011-01-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR target/47446
+	* config/i386/i386.c (ix86_output_addr_vec_elt): Check
+	TARGET_LP64 instead of TARGET_64BIT for ASM_QUAD.
+	(ix86_output_addr_diff_elt): Likewise.
+
 2011-01-21  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR target/47403
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 8427390..957fc2a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -15196,7 +15196,7 @@  ix86_output_addr_vec_elt (FILE *file, int value)
   const char *directive = ASM_LONG;
 
 #ifdef ASM_QUAD
-  if (TARGET_64BIT)
+  if (TARGET_LP64)
     directive = ASM_QUAD;
 #else
   gcc_assert (!TARGET_64BIT);
@@ -15211,13 +15211,13 @@  ix86_output_addr_diff_elt (FILE *file, int value, int rel)
   const char *directive = ASM_LONG;
 
 #ifdef ASM_QUAD
-  if (TARGET_64BIT && CASE_VECTOR_MODE == DImode)
+  if (TARGET_LP64 && CASE_VECTOR_MODE == DImode)
     directive = ASM_QUAD;
 #else
   gcc_assert (!TARGET_64BIT);
 #endif
   /* We can't use @GOTOFF for text labels on VxWorks; see gotoff_operand.  */
-  if (TARGET_64BIT || TARGET_VXWORKS_RTP)
+  if (TARGET_LP64 || TARGET_VXWORKS_RTP)
     fprintf (file, "%s%s%d-%s%d\n",
 	     directive, LPREFIX, value, LPREFIX, rel);
   else if (HAVE_AS_GOTOFF_IN_DATA)
diff --git a/gcc/testsuite/ChangeLog.x32 b/gcc/testsuite/ChangeLog.x32
index 4e2ef81..506585d 100644
--- a/gcc/testsuite/ChangeLog.x32
+++ b/gcc/testsuite/ChangeLog.x32
@@ -1,3 +1,8 @@ 
+2011-01-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR target/47446
+	* gcc.target/i386/pr47446-1.c: New.
+
 2011-01-21  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR target/47403
diff --git a/gcc/testsuite/gcc.target/i386/pr47446-1.c b/gcc/testsuite/gcc.target/i386/pr47446-1.c
new file mode 100644
index 0000000..38c9594
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47446-1.c
@@ -0,0 +1,40 @@ 
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+enum
+{
+  __GCONV_OK = 0,
+  __GCONV_NOCONV,
+  __GCONV_NODB,
+  __GCONV_NOMEM,
+  __GCONV_EMPTY_INPUT,
+  __GCONV_FULL_OUTPUT,
+  __GCONV_ILLEGAL_INPUT,
+  __GCONV_INCOMPLETE_INPUT,
+  __GCONV_ILLEGAL_DESCRIPTOR,
+  __GCONV_INTERNAL_ERROR
+};
+int
+foo (int result)
+{
+  int irreversible = 0;
+  switch (result)
+    {
+    case __GCONV_ILLEGAL_INPUT:
+      irreversible = -1L;
+      break;
+    case __GCONV_FULL_OUTPUT:
+      irreversible = -2L;
+      break;
+    case __GCONV_INCOMPLETE_INPUT:
+      irreversible = -3L;
+      break;
+    case __GCONV_EMPTY_INPUT:
+    case __GCONV_OK:
+      break;
+    default:
+      abort ();
+    }
+  return irreversible;
+}