> Am 05.11.2024 um 18:08 schrieb Jakub Jelinek <ja...@redhat.com>:
> 
> On Tue, Nov 05, 2024 at 05:56:09PM +0100, Uros Bizjak wrote:
>>> Maybe never make functions having any volatile asm() "leaf"?  Thus
>>> require 'volatile' to be present - aka the asm has side-effects that
>>> are not fully encoded in the constraints.
>> 
>> I think this would work!
>> 
>> Although this *might* be somehow a big hammer approach, disabling a
> 
> I think it will unnecessarily punish lots of code in the wild.

I don’t think it will matter in practice?  What else should volatile be for and 
why should it exclude this particular side-effect that cannot be expressed by 
constraints?  IMHO correctness trumps optimization here unless we want to 
retroactively document the red zone is off limits for any asm()?

Richard 

> Most asm volatile doesn't do calls in it, or if they do, they have learned
> in the past 20 years that on x86_64 there is a red zone and they need to
> first subtract red zone size from sp and restore it at the end.
> 
>    Jakub
> 

Reply via email to