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: Fix PR44281 (bad RA with global regs)


Hi,

On Mon, 29 Feb 2016, Bernd Schmidt wrote:

> On 02/29/2016 06:07 PM, Michael Matz wrote:
> 
> > %rbx would have to be implicitly used/clobbered by the asm.  In addition
> > it would have to be used by all function entries and exits (so that a
> > function body where the global reg var is merely visible but not used
> > doesn't accidentally clobber that register) and of course by calls.
> 
> Nearly all this exists as of today. From df-scan.c:

Okay, that looks good, I agree (modulo the asms).

> > FWIW: signal handlers need no consideration (if they were allowed to
> > inspect/alter global reg vars we would have lost and no improvement on
> > fixed_regs[] could be done).  They are explicitely documented to not be
> > able to access global reg vars.  (They already can't accidentally clobber
> > the register in question because signal handlers don't do that)
> 
> Oh, they can't modify the register in question because the OS would 
> restore it?

Yep.

> Ok so maybe reopen and apply my patch for gcc-7, with a tweak for asms.

That seems workable.  At least I can't imagine other implicit uses of such 
registers.


Ciao,
Michael.


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