This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCHv2/AARCH64 2/3] Fix TLS for ILP32.
- From: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>
- To: Andrew Pinski <apinski at cavium dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 20 Feb 2015 13:35:16 +0000
- Subject: Re: [PATCHv2/AARCH64 2/3] Fix TLS for ILP32.
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1393381023 dot git dot apinski at cavium dot com> <f5fab8235defbf1e46859ae14d91a1c405656c59 dot 1393381023 dot git dot apinski at cavium dot com>
> case SYMBOL_SMALL_GOTTPREL:
> {
> - rtx tmp_reg = gen_reg_rtx (Pmode);
> + /* In ILP32, the mode of dest can be either SImode or DImode,
> + while the got entry is always of SImode size. The mode of
> + dest depends on how dest is used: if dest is assigned to a
> + pointer (e.g. in the memory), it has SImode; it may have
> + DImode if dest is dereferenced to access the memeory.
> + This is why we have to handle three different tlsie_small
> + patterns here (two patterns for ILP32). */
> + enum machine_mode mode = GET_MODE (dest);
> + rtx tmp_reg = gen_reg_rtx (mode);
> rtx tp = aarch64_load_tp (NULL);
> - emit_insn (gen_tlsie_small (tmp_reg, imm));
> - emit_insn (gen_rtx_SET (Pmode, dest, gen_rtx_PLUS (Pmode, tp, tmp_reg)));
> +
> + if (mode == ptr_mode)
> + {
> + if (mode == DImode)
> + emit_insn (gen_tlsie_small_di (tmp_reg, imm));
> + else
> + {
> + emit_insn (gen_tlsie_small_si (tmp_reg, imm));
> + tp = gen_lowpart (mode, tp);
> + }
> + }
> + else
> + {
> + gcc_assert (mode == Pmode);
> + emit_insn (gen_tlsie_small_sidi (tmp_reg, imm));
> + }
Andrew, do you recall the circumstance that trigger the mode == SImode
code path through the above code? I've been trying to trigger this
while working on the equivalent tiny address mode code... with no
success.
/Marcus