From cc5cec10532400521b1e04129530007a724ff493 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sun, 26 Jan 2014 16:07:28 +0000 Subject: [PATCH] pa.c (pa_attr_length_indirect_call): Adjust length of portable runtime and PIC indirect calls. * config/pa/pa.c (pa_attr_length_indirect_call): Adjust length of portable runtime and PIC indirect calls. (pa_output_indirect_call): Remove unnecessary nop from portable runtime and PIC call sequences. Use ldo instead of blr to set return register in PIC call sequence. From-SVN: r207120 --- gcc/ChangeLog | 8 ++++++++ gcc/config/pa/pa.c | 18 +++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ccbea0f7158..460af5b2ea5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2014-01-26 John David Anglin + + * config/pa/pa.c (pa_attr_length_indirect_call): Adjust length of + portable runtime and PIC indirect calls. + (pa_output_indirect_call): Remove unnecessary nop from portable runtime + and PIC call sequences. Use ldo instead of blr to set return register + in PIC call sequence. + 2014-01-25 Walter Lee * config/tilegx/sync.md (atomic_fetch_sub): Fix negation and diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index d17a1af43c4..c5f87eab5d2 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -8106,10 +8106,10 @@ pa_attr_length_indirect_call (rtx insn) return 8; if (flag_pic) - return 24; + return 20; if (TARGET_PORTABLE_RUNTIME) - return 20; + return 16; /* Out of reach, can use ble. */ return 12; @@ -8154,28 +8154,28 @@ pa_output_indirect_call (rtx insn, rtx call_dest) return ".CALL\tARGW0=GR\n\tldil L'$$dyncall,%%r2\n\tble R'$$dyncall(%%sr4,%%r2)\n\tcopy %%r31,%%r2"; /* Long millicode call for portable runtime. */ - if (pa_attr_length_indirect_call (insn) == 20) - return "ldil L'$$dyncall,%%r31\n\tldo R'$$dyncall(%%r31),%%r31\n\tblr %%r0,%%r2\n\tbv,n %%r0(%%r31)\n\tnop"; + if (pa_attr_length_indirect_call (insn) == 16) + return "ldil L'$$dyncall,%%r31\n\tldo R'$$dyncall(%%r31),%%r31\n\tblr %%r0,%%r2\n\tbv,n %%r0(%%r31)"; /* We need a long PIC call to $$dyncall. */ xoperands[0] = NULL_RTX; - output_asm_insn ("{bl|b,l} .+8,%%r1", xoperands); + output_asm_insn ("{bl|b,l} .+8,%%r2", xoperands); if (TARGET_SOM || !TARGET_GAS) { xoperands[0] = gen_label_rtx (); - output_asm_insn ("addil L'$$dyncall-%0,%%r1", xoperands); + output_asm_insn ("addil L'$$dyncall-%0,%%r2", xoperands); targetm.asm_out.internal_label (asm_out_file, "L", CODE_LABEL_NUMBER (xoperands[0])); output_asm_insn ("ldo R'$$dyncall-%0(%%r1),%%r1", xoperands); } else { - output_asm_insn ("addil L'$$dyncall-$PIC_pcrel$0+4,%%r1", xoperands); + output_asm_insn ("addil L'$$dyncall-$PIC_pcrel$0+4,%%r2", xoperands); output_asm_insn ("ldo R'$$dyncall-$PIC_pcrel$0+8(%%r1),%%r1", xoperands); } - output_asm_insn ("blr %%r0,%%r2", xoperands); - output_asm_insn ("bv,n %%r0(%%r1)\n\tnop", xoperands); + output_asm_insn ("bv %%r0(%%r1)", xoperands); + output_asm_insn ("ldo 12(%%r2),%%r2", xoperands); return ""; } -- 2.30.2