[PATCH] Fix PR47286

Michael Matz matz@suse.de
Fri Jan 14 16:04:00 GMT 2011


Hi,

On Fri, 14 Jan 2011, Richard Guenther wrote:

> > You want to check DECL_HARD_REGISTER.  The above would also make
> > 
> >   register int x;
> > 
> > an escape point, although this is simply a normal local variable that you 
> > can't take the address of.
> 
> I have applied the following (but C doesn't seem to set DECL_HARD_REGISTER
> for global reg vars).

Sigh, indeed.  C++ seems to do, and in any case it would be more 
consistent to do it also for globals.  Maybe Joseph knows why C doesn't do 
that.

> The ME seems to use DECL_REGISTER and
> DECL_HARD_REGISTER in various inconsistent ways btw ...

Yeah, some of them use DECL_REGISTER because they want to handle global 
reg vars (which always have a hard-reg associated, as otherwise the 
register storage class is only valid for locals), and are posed with the 
above problem.  But some seem to really want DECL_HARD_REGISTER.


Ciao,
Michael.



More information about the Gcc-patches mailing list