diff mbox

[AArch64] Handle SYMBOL_SMALL_TPREL appropriately

Message ID 1422852769059.53654@caviumnetworks.com
State New
Headers show

Commit Message

Hurugalawadi, Naveen Feb. 2, 2015, 4:51 a.m. UTC
Hi,

Please find attached the patch that handles the operations on
SYMBOL_SMALL_TPREL appropriately.
It fixes gcc.dg/tls/opt-11.c regression on ilp32.

Please review the patch and let us know if its okay?
Regression tested on aarch64-elf.

Thanks,
Naveen

2015-02-02  Andrew Pinski  <apinski@cavium.com>
                    Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

        * config/aarch64/aarch64.c (*aarch64_load_symref_appropriately):
        Check whether the destination of SYMBOL_SMALL_TPREL is Pmode.

Comments

Andrew Pinski Feb. 8, 2015, 5:34 a.m. UTC | #1
On Sun, Feb 1, 2015 at 8:51 PM, Hurugalawadi, Naveen
<Naveen.Hurugalawadi@caviumnetworks.com> wrote:
> Hi,
>
> Please find attached the patch that handles the operations on
> SYMBOL_SMALL_TPREL appropriately.
> It fixes gcc.dg/tls/opt-11.c regression on ilp32.
>
> Please review the patch and let us know if its okay?
> Regression tested on aarch64-elf.

Also bootstrapped and tested on aarch64-linux-gnu with no regressions
(and many testcases in libgomp passing now).

Thanks,
Andrew Pinski

>
> Thanks,
> Naveen
>
> 2015-02-02  Andrew Pinski  <apinski@cavium.com>
>                     Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>
>
>         * config/aarch64/aarch64.c (*aarch64_load_symref_appropriately):
>         Check whether the destination of SYMBOL_SMALL_TPREL is Pmode.
Marcus Shawcroft Feb. 17, 2015, 10:40 a.m. UTC | #2
On 2 February 2015 at 04:51, Hurugalawadi, Naveen
<Naveen.Hurugalawadi@caviumnetworks.com> wrote:
> Hi,
>
> Please find attached the patch that handles the operations on
> SYMBOL_SMALL_TPREL appropriately.
> It fixes gcc.dg/tls/opt-11.c regression on ilp32.
>
> Please review the patch and let us know if its okay?
> Regression tested on aarch64-elf.
>
> Thanks,
> Naveen
>
> 2015-02-02  Andrew Pinski  <apinski@cavium.com>
>                     Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>
>
>         * config/aarch64/aarch64.c (*aarch64_load_symref_appropriately):
>         Check whether the destination of SYMBOL_SMALL_TPREL is Pmode.

OK, but fix the trailing white spacein the patch.  Can you prepare a
backport into 4.9 please? /Marcus
Hurugalawadi, Naveen Feb. 18, 2015, 4:45 a.m. UTC | #3
Hi Marcus,

Thanks for the review.

>> OK, but fix the trailing white space in the patch

Done. Committed with the modification.

>>  Can you prepare a backport into 4.9

ILP32 support is not completely added in 4.9 and hence the patch
is not needed.

Thanks,
Naveen
Marcus Shawcroft Feb. 18, 2015, 8:11 a.m. UTC | #4
On 18 February 2015 at 04:45, Hurugalawadi, Naveen
<Naveen.Hurugalawadi@caviumnetworks.com> wrote:
> Hi Marcus,
>
> Thanks for the review.
>
>>> OK, but fix the trailing white space in the patch
>
> Done. Committed with the modification.
>
>>>  Can you prepare a backport into 4.9
>
> ILP32 support is not completely added in 4.9 and hence the patch
> is not needed.

The handling of SYMBOL_SMALL_TPREL is present in 4.9 and very clearly
has exactly the same issue.
diff mbox

Patch

Index: gcc/config/aarch64/aarch64.c
===================================================================
--- gcc/config/aarch64/aarch64.c	(revision 220343)
+++ gcc/config/aarch64/aarch64.c	(working copy)
@@ -956,6 +956,10 @@ 
     case SYMBOL_SMALL_TPREL:
       {
 	rtx tp = aarch64_load_tp (NULL);
+	
+	if (GET_MODE (dest) != Pmode)
+	  tp = gen_lowpart (GET_MODE (dest), tp);
+
 	emit_insn (gen_tlsle_small (dest, tp, imm));
 	set_unique_reg_note (get_last_insn (), REG_EQUIV, imm);
 	return;