https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113293

--- Comment #2 from KBDeveloper <dories.spirits_0p at icloud dot com> ---
(In reply to Andrew Pinski from comment #1)
> The inline-asm is not marking as clobbering memory.
> 
> In this case since you just pass the address of the variable, gcc does not
> know the inline-asm will read memory at all, it deletes the store. Anyways
> adding "memory" as a clobber to the inline-asm, fixes the issue.

Ah, that makes sense. I had assumed that taking the address of arg would force
gcc to store it in memory somewhere. 
Is there a reason why gcc then allocates 8 bytes on the stack and fills r1 with
sp - #7? Or is what I had just UB and gcc can do whatever?

At any rate, thanks for the quick response.

Reply via email to