This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: reload infrastructure to fix PR target/21623
- From: Bernd Schmidt <bernds_cb1 at t-online dot de>
- To: Joern RENNECKE <joern dot rennecke at st dot com>
- Cc: Ian Lance Taylor <ian at airs dot com>, gcc-patches at gcc dot gnu dot org, Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>, aoliva at redhat dot com
- Date: Mon, 03 Oct 2005 19:55:22 +0200
- Subject: Re: RFA: reload infrastructure to fix PR target/21623
- References: <20050927.103622.26298462.kkojima@rr.iij4u.or.jp> <20050927.160054.68062105.kkojima@rr.iij4u.or.jp> <43392D3B.6020905@st.com> <20050927.231900.34738606.kkojima@rr.iij4u.or.jp> <433B0E9A.2000103@st.com> <433CF482.1080201@t-online.de> <433D40E1.5080109@st.com> <433D4227.4090004@st.com> <433D6009.7000002@st.com> <m3mzluxr1w.fsf@gossamer.airs.com> <433DAECA.1010902@st.com> <433E5537.6060402@t-online.de> <43412904.3070404@st.com> <43413BD5.6040107@t-online.de> <434157EA.4060008@st.com>
Joern RENNECKE wrote:
I suppose the best solution for that problem is to make the class
describe exclusively a
temp register. If no separate temp register is required, reload_class
can be returned
(alternatively, we could say NO_REGS should be returned, and make
push_secondary_reload test the icode as well as the class when deciding
if there is any
reload at all.)
That would be fine. So, IIUC the interface would be something like
/* Returns true if a secondary reload is needed for ...input args....
After return from this function, *PICODE and *PCLASS describe how to
do the secondary reload.
If *PICODE is CODE_FOR_nothing, only a simple move instruction with a
scratch register from *PCLASS is necessary, otherwise we use the
instruction pattern selected by *PICODE. CLASS can be NO_REGS in
that case, or it can describe another scratch register if we need
a tertiary reload. In any case, the instruction pattern will be
examined to determine the necessary class for the secondary reload
and potential scratch registers needed. */
bool (*secondary_foo_reload_needed_p)(...input args...,
enum insn_code *picode, enum reg_class *pclass);
and if an insn code is used, we pick the class of the secondary reload
and all scratch registers used by that pattern by looking at the operand
constraints?
Or lose the bool return; I suppose it's redundant with
icode != CODE_FOR_nothing || class != NO_REGS
Either way would be fine. If this works for you, go ahead - or do you
see a need to extend this, now or in the future? I'd just like to see
proper typing, no relying on the internal structure of enums, and no
effect on other parts of the compiler such as gencodes.
Bernd