This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING][PATCH] LRA: check_rtl modifies RTL instruction stream
- From: Alan Modra <amodra at gmail dot com>
- To: Michael Meissner <gnu at the-meissners dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Robert Suchanek <Robert dot Suchanek at imgtec dot com>, Vladimir Makarov <vmakarov at redhat dot com>, David Edelsohn <dje dot gcc at gmail dot com>, Peter Bergner <bergner at vnet dot ibm dot com>
- Date: Fri, 29 Nov 2013 10:20:08 +1030
- Subject: Re: [PING][PATCH] LRA: check_rtl modifies RTL instruction stream
- Authentication-results: sourceware.org; auth=none
- References: <B5E67142681B53468FAF6B7C313565623D34C7AA at KLMAIL01 dot kl dot imgtec dot org> <528CFD09 dot 5070200 at redhat dot com>
On Wed, Nov 20, 2013 at 11:18:49AM -0700, Jeff Law wrote:
> >2013-11-13 Robert Suchanek <Robert.Suchanek@imgtec.com>
> >
> > * lra.c (lra): Set lra_in_progress before check_rtl call.
> > * recog.c (insn_invalid_p): Add !lra_in_progress to prevent
> > adding clobber regs when LRA is running
Trying to run the testsuite with -mlra and the default -mcmodel=medium
on powerpc64 now results in enormous numbers of failures like the
following.
/home/alanm/src/gcc-virgin/libatomic/testsuite/libatomic.c/atomic-exchange-1.c:67:1: error: insn does not satisfy its constraints:
}
^
(insn 5 2 6 2 (set (reg/f:DI 212)
(mem/u/c:DI (unspec:DI [
(symbol_ref/u:DI ("*.LC0") [flags 0x2])
(reg:DI 2 2)
] UNSPEC_TOCREL) [0 S8 A8])) /home/alanm/src/gcc-virgin/libatomic/testsuite/libatomic.c/atomic-exchange-1.c:14 505 {*movdi_internal64}
(expr_list:REG_EQUAL (symbol_ref:DI ("v") <var_decl 0x3fff9bd00850 v>)
(nil)))
This is due to that innocuous seeming change of setting
lra_in_progress before calling check_rtl(), in combination with
previous changes Vlad made to the rs6000 backend here:
http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02208.html
In particular the "Call legitimate_constant_pool_address_p in strict
mode for LRA" change, that sets "strict" when lra_in_progress.
I'm not at all familiar with lra so why Vlad made those changes to
rs6000.c is totally opaque to me. If this were a reload problem I
could dive in and fix it, but not lra, sorry..
What I can say is that the rtl shown above is a toc reference of the
form that is valid for -mcmodel=small both before and after reload,
and generates "ld offset(r2)" machine instructions. The form is valid
for -mcmodel=medium/large only before reload. After reload it is
supposed to be split into high/lo_sum variants that generate
"addis rtmp,offset@ha(r2); ld offset@l(rtmp)".
--
Alan Modra
Australia Development Lab, IBM