On Thu, Nov 07, 2024 at 08:47:34AM +0100, Uros Bizjak wrote:
> Maybe we should always recognize "redzone", even for targets without
> it. This is the way we recognize "cc" even for targets without CC reg
> (e.g. alpha). This would simplify the definition and processing - if
> the hook returns NULL_RTX (the default), then it (obviously) won't be
> added to the clobber list.
Dunno, am open to that, but thought it would be just weird if one says
"redzone" on targets which don't have such a concept.
> > --- gcc/varasm.cc.jj 2024-11-06 10:23:21.215728007 +0100
> > +++ gcc/varasm.cc 2024-11-06 12:21:17.891908352 +0100
> > @@ -967,9 +967,11 @@ set_user_assembler_name (tree decl, cons
> >
> > /* Decode an `asm' spec for a declaration as a register name.
> > Return the register number, or -1 if nothing specified,
> > - or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized,
> > + or -2 if the ASMSPEC is not `cc' or `memory' or `redzone' and is not
> > + recognized,
> > or -3 if ASMSPEC is `cc' and is not recognized,
> > or -4 if ASMSPEC is `memory' and is not recognized.
>
> Comma at the end of this part of the sentence.
Fixed in my copy.
> > --- gcc/config/i386/i386.cc.jj 2024-11-05 08:55:41.661186354 +0100
> > +++ gcc/config/i386/i386.cc 2024-11-06 14:12:52.560168428 +0100
> > @@ -7172,7 +7172,8 @@ ix86_compute_frame_layout (void)
> > && crtl->sp_is_unchanging
> > && crtl->is_leaf
> > && !ix86_pc_thunk_call_expanded
> > - && !ix86_current_function_calls_tls_descriptor)
> > + && !ix86_current_function_calls_tls_descriptor
> > + && !cfun->machine->asm_redzone_clobber_seen)
>
> Please put the new check just after crtl-> checks.
Changed in my copy too.
The patch passed bootstrap/regtest on x86_64-linux and i686-linux btw.
Jakub