This is the mail archive of the gcc-patches@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 find a register to spill...


> On Thu, 18 Apr 2002, Richard Henderson wrote:
> > >    LIVE_KNOWN says we have valid information about which hard
> > >    regs are live at each point in the program; this is true when
> > >    we are called from global_alloc but false when stupid register
> > >    allocation has been done.
> > > is LIVE_KNOWN still of some use or should I just kill it?
> > 
> > I have no idea.  Bernd?
> 
> I missed the start of this thread.  How is it causing problems?

The problem is following pattern:

  [(set (match_operand:SI 0 "nonimmediate_operand" "=*a,r,*a,m,!*y,!rm,!*y,!*Y,!rm,!*Y")
	(match_operand:SI 1 "general_operand" "im,rinm,rinm,rin,rm,*y,*y,rm,*Y,*Y"))]

The first alternative is present to make instruction length computation come
out right (stores to eax are shorter) and it confuses reload.  When reloading
is needed, reload goes trought the alternatives computing number of moves
needed to satisfy each choosing first cheapest.  It forgets to compute
moves needed to free up register in given class when class if occupied, so
the alternative 0 comes out as expensive as alternative 1 in most cases
making reload to work hard and crash when eax is occupied (register passing
conventions on x86_64).

I am now fixing it by adding '?' in the alternative, but I was looking for
posibility to fix it properly and found the out of date comment above.
I am not sure whether we use LIVE_KNOWN at all now when the stupid is dead.

Honza
> 
> 
> Bernd


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