This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix PR44281 (bad RA with global regs)
- From: Michael Matz <matz at suse dot de>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 29 Feb 2016 19:49:54 +0100 (CET)
- Subject: Re: Fix PR44281 (bad RA with global regs)
- Authentication-results: sourceware.org; auth=none
- References: <56C78C62 dot 7050204 at t-online dot de> <56C79116 dot 2050503 at redhat dot com> <CAFiYyc3xBcxLfO0Rm2v0v-LPfAAGtiapPtF=eF33BTfey8bccQ at mail dot gmail dot com> <56D0723E dot 20805 at redhat dot com> <alpine dot LSU dot 2 dot 20 dot 1602291725400 dot 20277 at wotan dot suse dot de> <56D47C33 dot 1060305 at redhat dot com>
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.