https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124688
--- Comment #6 from Vineet Gupta <vineetg at gcc dot gnu.org> ---
(In reply to Jose E. Marchesi from comment #5)
> My point is that compiling your reproducer
>
> short ret_int ();
/me slaps myself. This is supposed to return int. I must have mixed 2 different
tests.
And with both arg/ret as short it does the same r1 = r0, although that's mor
eof an ABI fix.
> void arg_int (int);
>
> void foo () {
> arg_int(ret_int ());
> }
>
> with -O2 -mcpu=v4 results in:
>
> .file "foo.c"
> .text
> .align 3
> .global foo
> .type foo, @function
> foo:
> call ret_int
> w1 = (s16) w0
> call arg_int
> exit
> .size foo, .-foo
> .ident "GCC: (GNU) 16.0.1 20260401 (experimental)"
>
> So I don't know how you got:
>
> foo:
> call ret_int
> r1 = r0
> call arg_int
> exit