This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch to fix PR81481
- From: Richard Sandiford <richard dot sandiford at linaro dot org>
- To: Vladimir Makarov <vmakarov at redhat dot com>
- Cc: "gcc-patches\@gcc.gnu.org" <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 30 Sep 2017 09:15:01 +0100
- Subject: Re: patch to fix PR81481
- Authentication-results: sourceware.org; auth=none
- References: <1e28c7c0-3cec-8419-876f-cbfe41fdfd39@redhat.com>
Vladimir Makarov <vmakarov@redhat.com> writes:
> The following patch fixes
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81481
>
> The patch was bootstrapped and tested on x86-64.
>
> Committed as rev. 253300.
>
>
> Index: ira-costs.c
> ===================================================================
> --- ira-costs.c (revision 253253)
> +++ ira-costs.c (working copy)
> @@ -1471,7 +1471,10 @@ scan_one_insn (rtx_insn *insn)
> && targetm.legitimate_constant_p (GET_MODE (SET_DEST (set)),
> XEXP (note, 0))
> && REG_N_SETS (REGNO (SET_DEST (set))) == 1))
> - && general_operand (SET_SRC (set), GET_MODE (SET_SRC (set))))
> + && general_operand (SET_SRC (set), GET_MODE (SET_SRC (set)))
> + /* LRA does not use equiv with a symbol for PIC code. */
> + && (! ira_use_lra_p || ! pic_offset_table_rtx
> + || ! contains_symbol_ref_p (XEXP (note, 0))))
> {
> enum reg_class cl = GENERAL_REGS;
> rtx reg = SET_DEST (set);
I don't think this is the right test for PICness. Most targets have
an unconditional pic_offset_table_rtx.
Richard