This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: make PLUS commutative by default
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: dave at hiauly1 dot hia dot nrc dot ca (John David Anglin)
- Cc: joern dot rennecke at st dot com, gcc-patches at gcc dot gnu dot org, law at redhat dot com, dave dot anglin at nrc dot ca
- Date: Wed, 6 Jul 2005 12:34:03 -0400 (EDT)
- Subject: Re: RFA: make PLUS commutative by default
> > Unfortunately, I can't test this patch on an hppa system; I have
> > checked that it can cross-built a cc1, though, and am running
> > an i686-pc-linux-gnu bootstrap / regtest.
>
> I've started a test of the change on hppa2.0w-hp-hpux11.11 and
> hppa-unknown-linux-gnu. Should know in the morning how things
> turn out. However, the main is rather broken at the moment.
The builds were successful and no new regressions were noticed.
> > +/* ??? Addition is not commutative on the PA due to the weird implicit
> > + space register selection rules for memory addresses. Therefore, we
> > + don't consider a + b == b + a, as this might be inside a MEM. */
> > +static bool
> > +pa_commutative_p (rtx x, int outer_code)
> > +{
> > + return (COMMUTATIVE_P (x)
> > + && ((outer_code != UNKNOWN && outer_code != MEM)
> > + || GET_CODE (x) != PLUS));
> > +}
>
> The 32-bit linux runtime loads the same value in all space registers.
> Thus, the default definition should work for this target.
It's TARGET_NO_SPACE_REGS that determines whether or not addition
is commutative on HP PA.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)