===================================================================
@@ -303,6 +303,7 @@ extern enum attr_cpu ix86_schedule;
#endif
extern const char * ix86_output_call_insn (rtx_insn *insn, rtx call_op);
+extern const char * ix86_output_set_rip_insn (rtx *operands);
#ifdef RTX_CODE
/* Target data for multipass lookahead scheduling.
===================================================================
@@ -11225,8 +11225,6 @@ ix86_expand_prologue (void)
gcc_assert (Pmode == DImode);
label = gen_label_rtx ();
- emit_label (label);
- LABEL_PRESERVE_P (label) = 1;
tmp_reg = gen_rtx_REG (Pmode, R11_REG);
gcc_assert (REGNO (pic_offset_table_rtx) != REGNO (tmp_reg));
insn = emit_insn (gen_set_rip_rex64 (pic_offset_table_rtx,
@@ -12034,8 +12032,6 @@ ix86_expand_split_stack_prologue (void)
rtx x;
label = gen_label_rtx ();
- emit_label (label);
- LABEL_PRESERVE_P (label) = 1;
emit_insn (gen_set_rip_rex64 (reg10, label));
emit_insn (gen_set_got_offset_rex64 (reg11, label));
emit_insn (ix86_gen_add3 (reg10, reg10, reg11));
@@ -25016,6 +25012,17 @@ ix86_output_call_insn (rtx_insn *insn, rtx call_op
return "";
}
+
+/* Output the assembly for a SET_RIP instruction. We do so with this output
+ function to ensure that the label and %rip load instruction are together. */
+
+const char *
+ix86_output_set_rip_insn (rtx *operands)
+{
+ output_asm_label (operands[1]);
+ output_asm_insn ("lea{q}\t{%l1(%%rip), %0|%0, %l1[rip]}", operands);
+ return "";
+}
/* Clear stack slot assignments remembered from previous functions.
This is called from INIT_EXPANDERS once before RTL is emitted for each
===================================================================
@@ -12010,7 +12010,7 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(unspec:DI [(label_ref (match_operand 1))] UNSPEC_SET_RIP))]
"TARGET_64BIT"
- "lea{q}\t{%l1(%%rip), %0|%0, %l1[rip]}"
+ "* return ix86_output_set_rip_insn (operands);"
[(set_attr "type" "lea")
(set_attr "length_address" "4")
(set_attr "mode" "DI")])