On Thu, Jan 19, 2017 at 12:17:40PM +0000, Kyrill Tkachov wrote: > Hi all, > > The patch that renamed all uses of aarch64_nopcrelative_literal_loads into > aarch64_pcrelative_literal_loads missed out its extern declaration in > aarch64-protos.h and a couple of its uses in aarch64.md. > The aarch64_nopcrelative_literal_loads doesn't get initialised anywhere > (since it's unlinked from the command-line option handling machinery) so the > code that uses it is bogus. > > In any case, its use in the aarch64_reload_movcp<GPF_TF:mode><P:mode> and > aarch64_reload_movcp<VALL:mode><P:mode> expanders is redundant since they are > only ever called through aarch64_secondary_reload which gates their use on > !aarch64_pcrelative_literal_loads already. Since these are not standard > names, their conditions don't actually matter in any way or checked at any > point in the compilation AFAICS.
But more importantly, as it stands if this condition were ever not eliminated there would be a link time error - so the code is dead and dangerous and removing it is not concerning even at this stage in development. This patch is OK. Thanks, James > diff --git a/gcc/config/aarch64/aarch64-protos.h > b/gcc/config/aarch64/aarch64-protos.h > index > 29a3bd71151aa4fb7c6728f0fb52e2f3f233f41d..17d8a89ef0ce58b28fc8fc4713edcc4b194bbc90 > 100644 > --- a/gcc/config/aarch64/aarch64-protos.h > +++ b/gcc/config/aarch64/aarch64-protos.h > @@ -453,7 +453,6 @@ int aarch64_ccmp_mode_to_code (enum machine_mode mode); > bool extract_base_offset_in_addr (rtx mem, rtx *base, rtx *offset); > bool aarch64_operands_ok_for_ldpstp (rtx *, bool, enum machine_mode); > bool aarch64_operands_adjust_ok_for_ldpstp (rtx *, bool, enum machine_mode); > -extern bool aarch64_nopcrelative_literal_loads; > > extern void aarch64_asm_output_pool_epilogue (FILE *, const char *, > tree, HOST_WIDE_INT); > diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md > index > 7aaebd230ddb702447dd4a5d1ba4ab05441cb10a..2b0c2cc01e72d635f85ce4c56be1407986377ab3 > 100644 > --- a/gcc/config/aarch64/aarch64.md > +++ b/gcc/config/aarch64/aarch64.md > @@ -5044,7 +5044,7 @@ (define_expand > "aarch64_reload_movcp<GPF_TF:mode><P:mode>" > [(set (match_operand:GPF_TF 0 "register_operand" "=w") > (mem:GPF_TF (match_operand 1 "aarch64_constant_pool_symref" "S"))) > (clobber (match_operand:P 2 "register_operand" "=&r"))] > - "TARGET_FLOAT && aarch64_nopcrelative_literal_loads" > + "TARGET_FLOAT" > { > aarch64_expand_mov_immediate (operands[2], XEXP (operands[1], 0)); > emit_move_insn (operands[0], gen_rtx_MEM (<GPF_TF:MODE>mode, > operands[2])); > @@ -5057,7 +5057,7 @@ (define_expand "aarch64_reload_movcp<VALL:mode><P:mode>" > [(set (match_operand:VALL 0 "register_operand" "=w") > (mem:VALL (match_operand 1 "aarch64_constant_pool_symref" "S"))) > (clobber (match_operand:P 2 "register_operand" "=&r"))] > - "TARGET_FLOAT && aarch64_nopcrelative_literal_loads" > + "TARGET_FLOAT" > { > aarch64_expand_mov_immediate (operands[2], XEXP (operands[1], 0)); > emit_move_insn (operands[0], gen_rtx_MEM (<VALL:MODE>mode, operands[2]));