[Bug rtl-optimization/82803] Wildly excessive calls to __tls_get_addr with optimizations enabled.
ebotcazou at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Oct 13 09:52:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82803
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ebotcazou at gcc dot gnu.org
--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> The main reason is __tls_get_addr emitted as a normal call on RTL (for each
> GIMPLE access to the variable), but unless I'm missing something RTL doesn't
> have a notion of pure/const calls, so RTL loop invariant motion and CSE
> cannot clean up the redundant calls.
/* 1 if RTX is a call to a const function. Built from ECF_CONST and
TREE_READONLY. */
#define RTL_CONST_CALL_P(RTX) \
(RTL_FLAG_CHECK1 ("RTL_CONST_CALL_P", (RTX), CALL_INSN)->unchanging)
/* 1 if RTX is a call to a pure function. Built from ECF_PURE and
DECL_PURE_P. */
#define RTL_PURE_CALL_P(RTX) \
(RTL_FLAG_CHECK1 ("RTL_PURE_CALL_P", (RTX), CALL_INSN)->return_val)
/* 1 if RTX is a call to a const or pure function. */
#define RTL_CONST_OR_PURE_CALL_P(RTX) \
(RTL_CONST_CALL_P (RTX) || RTL_PURE_CALL_P (RTX))
/* 1 if RTX is a call to a looping const or pure function. Built from
ECF_LOOPING_CONST_OR_PURE and DECL_LOOPING_CONST_OR_PURE_P. */
#define RTL_LOOPING_CONST_OR_PURE_CALL_P(RTX) \
(RTL_FLAG_CHECK1 ("CONST_OR_PURE_CALL_P", (RTX), CALL_INSN)->call)
More information about the Gcc-bugs
mailing list