From 18efb1796541e7ebc9f9634755bfaf5c21a17773 Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Tue, 6 May 2008 10:07:13 +0000 Subject: [PATCH] i386.c (output_set_got): Fix for x86_64 output_emit_asm by using 'q' specifier for instruction. 2008-05-06 Kai Tietz * config/i386/i386.c (output_set_got): Fix for x86_64 output_emit_asm by using 'q' specifier for instruction. (ix86_file_end): Replaced case TARGET_64BIT_MS_ABI by TARGET_64BIT. From-SVN: r134981 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 48 +++++++++++++++++++++++++++--------------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8f95e0d41c3..b8e97904198 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-05-06 Kai Tietz + + * config/i386/i386.c (output_set_got): Fix for x86_64 output_emit_asm + by using 'q' specifier for instruction. + (ix86_file_end): Replaced case TARGET_64BIT_MS_ABI by TARGET_64BIT. + 2008-05-06 Anatoly Sokolov * config/avr/avr.md (*sbrx_branch, *sbix_branch, *sbix_branch_tmp): diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 6b9ad68511f..a61bfb7f154 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5884,20 +5884,14 @@ ix86_file_end (void) switch_to_section (text_section); ASM_OUTPUT_LABEL (asm_out_file, name); } - if (TARGET_64BIT_MS_ABI) - { - xops[0] = gen_rtx_REG (Pmode, regno); - xops[1] = gen_rtx_MEM (Pmode, stack_pointer_rtx); - output_asm_insn ("mov{q}\t{%1, %0|%0, %1}", xops); - output_asm_insn ("ret", xops); - } + + xops[0] = gen_rtx_REG (Pmode, regno); + xops[1] = gen_rtx_MEM (Pmode, stack_pointer_rtx); + if (TARGET_64BIT) + output_asm_insn ("mov{q}\t{%1, %0|%0, %1}", xops); else - { - xops[0] = gen_rtx_REG (SImode, regno); - xops[1] = gen_rtx_MEM (SImode, stack_pointer_rtx); - output_asm_insn ("mov{l}\t{%1, %0|%0, %1}", xops); - output_asm_insn ("ret", xops); - } + output_asm_insn ("mov{l}\t{%1, %0|%0, %1}", xops); + output_asm_insn ("ret", xops); } if (NEED_INDICATE_EXEC_STACK) @@ -5936,7 +5930,12 @@ output_set_got (rtx dest, rtx label ATTRIBUTE_UNUSED) xops[2] = gen_rtx_LABEL_REF (Pmode, label ? label : gen_label_rtx ()); if (!flag_pic) - output_asm_insn ("mov{l}\t{%2, %0|%0, %2}", xops); + { + if (TARGET_64BIT) + output_asm_insn ("mov{q}\t{%2, %0|%0, %2}", xops); + else + output_asm_insn ("mov{l}\t{%2, %0|%0, %2}", xops); + } else output_asm_insn ("call\t%a2", xops); @@ -5951,7 +5950,12 @@ output_set_got (rtx dest, rtx label ATTRIBUTE_UNUSED) CODE_LABEL_NUMBER (XEXP (xops[2], 0))); if (flag_pic) - output_asm_insn ("pop{l}\t%0", xops); + { + if (TARGET_64BIT) + output_asm_insn ("pop{q}\t%0", xops); + else + output_asm_insn ("pop{l}\t%0", xops); + } } else { @@ -5977,9 +5981,19 @@ output_set_got (rtx dest, rtx label ATTRIBUTE_UNUSED) return ""; if (!flag_pic || TARGET_DEEP_BRANCH_PREDICTION) - output_asm_insn ("add{l}\t{%1, %0|%0, %1}", xops); + { + if (TARGET_64BIT) + output_asm_insn ("add{q}\t{%1, %0|%0, %1}", xops); + else + output_asm_insn ("add{l}\t{%1, %0|%0, %1}", xops); + } else - output_asm_insn ("add{l}\t{%1+[.-%a2], %0|%0, %1+(.-%a2)}", xops); + { + if (TARGET_64BIT) + output_asm_insn ("add{q}\t{%1+[.-%a2], %0|%0, %1+(.-%a2)}", xops); + else + output_asm_insn ("add{l}\t{%1+[.-%a2], %0|%0, %1+(.-%a2)}", xops); + } return ""; } -- 2.30.2