This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fwd: [PATCH] Scheduling result adjustment to enable macro-fusion
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Wei Mi <wmi at google dot com>, Jan Hubicka <hubicka at ucw dot cz>, Alexander Monakov <amonakov at ispras dot ru>, Steven Bosscher <stevenb dot gcc at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Tue, 24 Sep 2013 23:25:16 +0200
- Subject: Re: Fwd: [PATCH] Scheduling result adjustment to enable macro-fusion
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOo-dc7=ax8_pA21wuxnqphLBvf_Voi2n1OHJX7ZEab=ew at mail dot gmail dot com> <CA+4CFy4fqCRvM2Luw2_p6AEZOmucSV1KemntEO3_XU5TfzA-7A at mail dot gmail dot com> <CA+4CFy6gdxREYiJa2B70RBe2aUtLY3zQ9ShK9jGEy26Hdn9QOg at mail dot gmail dot com> <CAMe9rOp1R8XACsL=v-JZkvpPzTOFiZhZPMqQXWkmPgHW5cjC6w at mail dot gmail dot com> <CA+4CFy5nM2Dw7kv0G61N5PKHoAanmAaKm+45oS4pN22TKgSAFg at mail dot gmail dot com> <20130922095726 dot GA23006 at atrey dot karlin dot mff dot cuni dot cz> <20130922101916 dot GA31130 at atrey dot karlin dot mff dot cuni dot cz> <CA+4CFy5n=rTH+fmndNXLJkJgzLd4uCmucvPf+QfGWNsvhPQ1CQ at mail dot gmail dot com> <CA+4CFy7TCbnm3irCTKYuQmsz_xPNbC3YmugHC6fjiewPcREzZA at mail dot gmail dot com> <CAMe9rOqLzrsxkfbSLqT29cntdJ_8PURh2NRmoLzQKM5Fzv8BEQ at mail dot gmail dot com>
> > + gcc_assert (ok);
> > + base = parts.base;
> > + index = parts.index;
> > + disp = parts.disp;
> > +
> > + if (TARGET_64BIT && !base && !index)
> > + {
> > + rtx symbol = disp;
> > +
> > + if (GET_CODE (disp) == CONST
> > + && GET_CODE (XEXP (disp, 0)) == PLUS
> > + && CONST_INT_P (XEXP (XEXP (disp, 0), 1)))
> > + symbol = XEXP (XEXP (disp, 0), 0);
> > +
> > + if (GET_CODE (symbol) == LABEL_REF
> > + || (GET_CODE (symbol) == SYMBOL_REF
> > + && SYMBOL_REF_TLS_MODEL (symbol) == 0))
> > + return true;
> > + }
> > + if (flag_pic && !base && !index)
> > + {
> > + if (GET_CODE (disp) == CONST
> > + && GET_CODE (XEXP (disp, 0)) == UNSPEC
> > + && (XINT (XEXP (disp, 0), 1) == UNSPEC_PCREL
> > + || XINT (XEXP (disp, 0), 1) == UNSPEC_GOTPCREL
> > + || (TARGET_64BIT
> > + && XINT (XEXP (disp, 0), 1) == UNSPEC_GOTNTPOFF)))
> > + return true;
> > + }
> > + return false;
> > +}
> > +
>
> It doesn't look right. IP relative address is only possible
> with TARGET_64BIT and
>
> 1. base == pc. Or
> 2. UUNSPEC_PCREL, UNSPEC_GOTPCREL, and
> NSPEC_GOTNTPOFF.
Target 64bit should be tested above. We however output RIP addresses
also for basic symbol references. I.e. when base is an symbol addresss.
such as in:
int a;
int t()
{
return a;
}
memory_address_length already contains logic to figure out if there is IP
relative addressing going on (I am not sure it is completely accurate either).
Better to break it out to a common predicate and perhaps unify with what
ix86_print_operand_address is doing.
Honza
>
>
> --
> H.J.