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]
Other format: [Raw text]

Re: Unable to generate reloads


You really haven't provided enough information for a definitive diagnosis, but....

reload comes into play when a pattern in the .md file matches an INSN in the
function you are compiling, but the constraint letters DON'T match.   So, it
would seem very likely that the define_insn pattern you have for QI moves
doesn't have a pair of matching constraints that the source and destination
are compatible with.

In the case that the constraints don't match, reload has some heuristics that it uses
to transform the INSN into a sequence of insns using compatible constraints.  (Typically,
it tries something like moving the source operand to a register and then using the register
as the source of the move to memory - if you don't have any registers, that constraint is
going to fail miserably......

You might want to share the define_insn pattern with us, or just check to see that you have
a "m" constraint on the destination and a "i" constraint on the source (in the same position on
the comma-list of alternatives....)  Take a look at almost any existing machine's "movqi" pattern and
the associated define_insn that matches the emitted (SET (..) (...)) rtl.


At 3:14 PM +0100 3/18/02, Alexandre Courbot wrote:

>Hello everybody,
>
>I'm currently porting GCC to our architecture. I managed to get a basic
>MD completed so GCC does compile, but when trying to compile the
>following simple program:
>
>char c;
>
>int barfunc()
>{
>    c = 2;
>}
>
>But GCC complains:
>
>test.c: In function `barfunc':
>test.c:6: Unable to generate reloads for:
>
>(insn 9 8 10 (set (mem/f:QI (reg/f:SI 15) 0)
>        (const_int 2 [0x2])) 1 {movqi} (nil)
>    (expr_list:REG_DEAD (reg/f:SI 15)
>        (nil)))
>test.c:6: Internal compiler error in find_reloads, at reload.c:3486
>
>From the manual, it looks like there is a problem with the register
>allocation or something like this, as it fails in the reload pass - but
>I still can't get what's wrong with it. It's the first time I mess with
>GCC, and a lot of its internals are still unclear to me. Although the
>machine I'm porting GCC to is register-less, I've defined 10 dummy
>hard-register for testing purposes. Does someone see something I missed
>and could give me a pointer to where the error could come from? Should I
>provide more information?

	
>
>Thank you for your time,
>Alex.
>--
>http://www.gnurou.org

-- 
------------------------------------------------------------------------

		    Quality Software Management
		http://home.earthlink.net/~qsmgmt
			apl@alum.mit.edu
			(978)287-0435 Voice
			(978)808-6836 Cell
			(978)287-0436 Fax

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation


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