@@ -1,5 +1,14 @@
2011-02-14 H.J. Lu <hongjiu.lu@intel.com>
+ * config/i386/i386.c (ix86_output_addr_vec_elt): Output
+ 64bit value for labels for TARGET_X32.
+
+ * config/i386/i386.md (*tablejump_1): Don't disable for
+ TARGET_X32.
+ (*tablejump_1_x32): Removed.
+
+2011-02-14 H.J. Lu <hongjiu.lu@intel.com>
+
PR middle-end/47727
* explow.c (convert_memory_address_addr_space): Permute the
conversion and addition if one operand is a constant.
@@ -15319,14 +15319,22 @@ ix86_output_addr_vec_elt (FILE *file, int value)
{
const char *directive = ASM_LONG;
+ if (TARGET_X32)
+ {
+ fprintf (file, "%s%s%d\n", directive, LPREFIX, value);
+ fprintf (file, "%s0\n", directive);
+ }
+ else
+ {
#ifdef ASM_QUAD
- if (TARGET_LP64)
- directive = ASM_QUAD;
+ if (TARGET_LP64)
+ directive = ASM_QUAD;
#else
- gcc_assert (!TARGET_64BIT);
+ gcc_assert (!TARGET_64BIT);
#endif
- fprintf (file, "%s%s%d\n", directive, LPREFIX, value);
+ fprintf (file, "%s%s%d\n", directive, LPREFIX, value);
+ }
}
void
@@ -11236,15 +11236,7 @@
(define_insn "*tablejump_1"
[(set (pc) (match_operand:P 0 "nonimmediate_operand" "rm"))
(use (label_ref (match_operand 1 "" "")))]
- "!TARGET_X32"
- "jmp\t%A0"
- [(set_attr "type" "ibr")
- (set_attr "length_immediate" "0")])
-
-(define_insn "*tablejump_1_x32"
- [(set (pc) (match_operand:P 0 "register_operand" "r"))
- (use (label_ref (match_operand 1 "" "")))]
- "TARGET_X32"
+ ""
"jmp\t%A0"
[(set_attr "type" "ibr")
(set_attr "length_immediate" "0")])
Pmode is used in non-PIC tablejump, we have to put 64bit value for labels with 0 upper 32bits in tablejump for x32. I checked it in. H.J. -- From 1665aa7685af162d127cbd8f2769d6b9683921f2 Mon Sep 17 00:00:00 2001 From: H.J. Lu <hjl.tools@gmail.com> Date: Mon, 14 Feb 2011 21:06:43 -0800 Subject: [PATCH 1/2] Use 64bit value in tablejump for x32. --- gcc/ChangeLog.x32 | 9 +++++++++ gcc/config/i386/i386.c | 16 ++++++++++++---- gcc/config/i386/i386.md | 10 +--------- 3 files changed, 22 insertions(+), 13 deletions(-)