This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] diagnose unsupported uses of hardware register variables (PR 88000)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Martin Sebor <msebor at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 14 Nov 2018 13:27:26 +0100
- Subject: Re: [PATCH] diagnose unsupported uses of hardware register variables (PR 88000)
- References: <20181114122250.GZ23873@gate.crashing.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Nov 14, 2018 at 06:22:51AM -0600, Segher Boessenkool wrote:
> Btw, if you just add
>
> void *
> retsp (void)
> {
> register void *sp __asm ("sp");
> asm ("" : "+g" (sp)); // <-- this line
> return sp;
> }
>
> everything works fine.
Even in what you are proposing, i.e. handle the var as any other var
in SSA form and only copy into the hard register right before asm and out of
it after it?
Because
{
void *sp;
asm ("" : "+g" (sp));
return sp;
}
would store into the register default definition of the SSA_NAME (the var
has no initializer).
Jakub