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

--- Comment #7 from Qing Zhao <qing.zhao at oracle dot com> ---
thank you, Wilco.
> Wilco <wilco at gcc dot gnu.org> changed:
> 
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                 CC|                            |wilco at gcc dot gnu.org
> 
> --- Comment #6 from Wilco <wilco at gcc dot gnu.org> ---
> The implementation of __builtin_update_setjmp_buf is incorrect, it takes a
> pointer (ie. SImode in ILP32) and treats the result of the add as Pmode
> (DImode). So it's missing a cast to Pmode.

Yes, this was what I thought too after more study.

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?

Reply via email to