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: discouraging register use


DJ Delorie <dj@redhat.com> writes:

> > > >   [(set (match_operand:SI 0 "" "c,c,?m,?m")
> > > >         (plus:SI (match_operand:SI 1 "" "0,0,0,0")
> > > > 		 (match_operand:SI 1 "" "c,?m,c,?m")))]
> > > 
> > > Yes, that looks plausible.  The other way isn't going to work because
> > > you penalize c at the same time as m by using "?cm".
> > > 
> > > Does it actually work?
> > 
> > One case I tried seems to work,
> 
> I found out a seemingly fundamental breakage for this.
> 
> In reload.c, we read:
> 
>       /* If this alternative can be made to work by reloading,
> 	 and it needs less reloading than the others checked so far,
> 	 record it as the chosen goal for reloading.  */
> 
> Apparently, if reloading is needed, ONE alternative is chosen, and
> reload tries to make it work.  If it fails, there doesn't seem to be a
> mechanism for trying other alternatives to see if they work.  Am I
> reading this right?

I think the best way to put this is that the chosen alternative must
be chosen so that reloading will succeed.


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