This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: (mem (plus (mem (plus ...


On Wed, Apr 25, 2001 at 10:23:53AM -0700, Greg McGary wrote:
> I'm writing a new port to a MIPS-like RISC target.
> 
> Things are mostly working, but I get a number of compile failures with
> -O0 wherein reload replaces a base register with a stack slot,
> yielding this sort of nonsense:
> 
> gcc.c-torture/compile/20010102-1.c:101: Insn does not satisfy its constraints:
> (insn 93 360 96 (set (mem/s:SI (plus:SI (mem:SI (plus:SI (reg/f:SI 29 $fp)
>                         (const_int 28 [0x1c])) 0)
>                 (const_int 4 [0x4])) 0)
>         (reg:SI 2 $v0)) 8 {*movsi} (nil)
>     (nil))
> 
> My eyes are starting to glaze over when I try to debug it in gdb.  If
> someone has tripped over this before, please give me a hint on where I
> might look for the trouble.
> 
> (I'm hoping it's a simple, stupid error in the md file.  A couple days
> ago, I had an abort in mark_referenced_resources that turned out to be
> caused by a missing '=' in the destination constraint of an insn
> pattern.)

Mostly likely it is an error in GO_IF_LEGITIMATE_ADDRESS and friends.  When I
work on a port for some time, or create a new port, one of the first things
that I do is move GO_IF_LEGITIMATE_ADDRESS into a function (note, it is tricky
because GILA is invoked twice, once with stict checking on where pseudos aren't
allowed, and once before register allocation has been done).  I usually also
add a -mdebug-addr option to dump to standard error all of the calls to GILA,
and whether they succeeded or failed.  The main advantage of moving it to a
function is you can debug it -- I also tend to move FUNCTION_ARG* into
functions.  Look at the d30v port for an example of this.

-- 
Michael Meissner, Red Hat, Inc.  (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]