From: John David Anglin Date: Mon, 12 Mar 2012 17:00:01 +0000 (+0000) Subject: Backport for mainline X-Git-Tag: releases/gcc-4.6.4~645 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddc8a3c98265b685e8267c83f24de77c1fdd7a4a;p=thirdparty%2Fgcc.git Backport for mainline 2012-01-28 John David Anglin PR target/51871 * config/pa/pa.c (pa_return_addr_rtx): Add support for PA2.0 export stubs. From-SVN: r185251 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 816a8d870b9a..296caa2b0cd2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2012-03-12 John David Anglin + + Backport for mainline + 2012-01-28 John David Anglin + + PR target/51871 + * config/pa/pa.c (pa_return_addr_rtx): Add support for PA2.0 export + stubs. + 2012-03-06 Michael Meissner Backport from mainline diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index d5780e5e6782..1eaa88d222e8 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -4586,7 +4586,7 @@ return_addr_rtx (int count, rtx frameaddr) rtx saved_rp; rtx ins; - /* Instruction stream at the normal return address for the export stub: + /* The instruction stream at the return address of a PA1.X export stub is: 0x4bc23fd1 | stub+8: ldw -18(sr0,sp),rp 0x004010a1 | stub+12: ldsid (sr0,rp),r1 @@ -4594,10 +4594,16 @@ return_addr_rtx (int count, rtx frameaddr) 0xe0400002 | stub+20: be,n 0(sr0,rp) 0xe0400002 must be specified as -532676606 so that it won't be - rejected as an invalid immediate operand on 64-bit hosts. */ + rejected as an invalid immediate operand on 64-bit hosts. - HOST_WIDE_INT insns[4] = {0x4bc23fd1, 0x004010a1, 0x00011820, -532676606}; - int i; + The instruction stream at the return address of a PA2.0 export stub is: + + 0x4bc23fd1 | stub+8: ldw -18(sr0,sp),rp + 0xe840d002 | stub+12: bve,n (rp) + */ + + HOST_WIDE_INT insns[4]; + int i, len; if (count != 0) return NULL_RTX; @@ -4620,11 +4626,26 @@ return_addr_rtx (int count, rtx frameaddr) ins = copy_to_reg (gen_rtx_AND (Pmode, rp, MASK_RETURN_ADDR)); label = gen_label_rtx (); + if (TARGET_PA_20) + { + insns[0] = 0x4bc23fd1; + insns[1] = -398405630; + len = 2; + } + else + { + insns[0] = 0x4bc23fd1; + insns[1] = 0x004010a1; + insns[2] = 0x00011820; + insns[3] = -532676606; + len = 4; + } + /* Check the instruction stream at the normal return address for the export stub. If it is an export stub, than our return address is really in -24[frameaddr]. */ - for (i = 0; i < 3; i++) + for (i = 0; i < len; i++) { rtx op0 = gen_rtx_MEM (SImode, plus_constant (ins, i * 4)); rtx op1 = GEN_INT (insns[i]);