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

--- Comment #8 from Wilco <wilco at gcc dot gnu.org> ---
(In reply to Qing Zhao from comment #7)

> However, I am still not very sure about the current implementation of
> -mabi=ilp32 on aarch64
> for example:
> 
> qinzhao@gcc116:~/Bugs/80295$ cat t1.c
> void f (void *b) { __builtin_return(b); }
> qinzhao@gcc116:~/Bugs/80295$ sh t1
> /home/qinzhao/Install/latest/bin/gcc -mabi=ilp32 -fdump-rtl-all
> -fdump-tree-all t1.c
> 
> in t1.c.231r.expand, I see the following stack pushing RTL insn:
> 
> (insn 2 4 3 2 (set (mem/f/c:SI (plus:DI (reg/f:DI 68 virtual-stack-vars)
>                 (const_int -4 [0xfffffffffffffffc])) [1 b+0 S4 A32])
>         (reg:SI 0 x0 [ b ])) "t1.c":1 -1
>      (nil))
> 
> the above looks like that ilp32 treats the stack pushing as 32 bit (not 64
> bits as aarch64 LP64 mode).
> is this right?

You're compiling without optimization, so the above instruction is spilling b
to the stack (not a push, just a store - there are no callee-saves for this
function). And b is SImode in ILP32, so it's correct.

Reply via email to