Set insn_last_address in final_1
final_1 already sets insn_current_address for each instruction, making
it possible to use some of the address functions in final.c during
assembly generation. This patch also sets insn_last_address, since
as the comment says, we can treat final as a shorten_branches pass that
does nothing. It's then possible to use insn_current_reference_address
during final as well.
This is needed for the aarch64.md definitions of far_branch to work:
(set (attr "far_branch")
(if_then_else (and (ge (minus (match_dup 2) (pc)) (const_int -
1048576))
(lt (minus (match_dup 2) (pc)) (const_int
1048572)))
(const_int 0)
(const_int 1)))]
This value (tested only during final) uses the difference between
the INSN_ADDRESSES of operand 2 and insn_current_reference_address
to calculate a conservatively-correct estimate of the branch distance.
It takes into account the worst-case gap due to alignment, whereas
a direct comparison of INSN_ADDRESSES would give an unreliable,
optimistic result.
2018-04-10 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* final.c (final_1): Set insn_last_address as well as
insn_current_address.
From-SVN: r259267