> diff --git a/gcc/testsuite/gcc.target/bpf/ret-reuse-arg-1.c 
> b/gcc/testsuite/gcc.target/bpf/ret-reuse-arg-1.c
> new file mode 100644
> index 000000000000..6d0a4f280cd7
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/bpf/ret-reuse-arg-1.c
> @@ -0,0 +1,14 @@
> +/* Return value of first call is arg to second call.  */
> +
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -mcpu=v4" } */
> +
> +int ret_int ();
> +void arg_int (int);
> +
> +void foo () {
> +   arg_int(ret_int ());
> +}
> +
> +/* { dg-final { scan-assembler-not {r1 = r0} } } */
> +/* { dg-final { scan-assembler-times {w1 = w0} 1 } } */

As discussed in BZ 124688, these expected results are incorrect.  There
is absolutely nothing wrong with the mov.

As things stand now, it is the callee that converts the value returned,
not the caller.  Once we change the ABI to match llvm a conversion will
happen after the call, but even then a mov will be still the right
instruction to use to move a value of any mode from register to
register, provided the mode is not changed.

Reply via email to