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

--- Comment #3 from rguenther at suse dot de <rguenther at suse dot de> ---
> Am 05.01.2026 um 08:50 schrieb ebotcazou at gcc dot gnu.org 
> <[email protected]>:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123358
> 
> Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
> 
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>           Keywords|ice-on-valid-code           |ice-on-invalid-code
> 
> --- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
>> Confirmed.  I believe this is wrong at gimplification time:
>> 
>> void bar ()
>> {
>>  __asm__ __volatile__("mov %1, %0" :  : "m" at);
>> }
>> 
>> we'd need to gimplify this to a temporary.  We have a CONST_DECL here which
>> is what confuses us (we're not going to put that into the constant pool
>> I guess).  Possibly
>> 
>> 3738          op = expand_expr (val, NULL_RTX, VOIDmode,
>> 3739                            allows_reg ? EXPAND_NORMAL
>> 3740                            : allows_mem ? EXPAND_MEMORY
>> 3741                            : EXPAND_INITIALIZER);
>> 
>> expects that this expands to a MEM because of EXPAND_MEMORY, but it does not
>> (errorneously?!).
> 
> CONST_DECLs are unconditionally replaced with their value, but it's apparently
> TREE_ADDRESSABLE here so we presumably cannot spill it at will.

I’d suggest to work around in gimplification (which might be what makes this
addressable).  Otherwise we’d need to make sure to put address taken CONST_DECL
in the constant pool when EXPAND_MEMORY?

> --
> You are receiving this mail because:
> You are on the CC list for the bug.

Reply via email to