xtensa: gcc: fix builtin_apply return value
authorMax Filippov <jcmvbkbc@gmail.com>
Sun, 11 Sep 2022 00:31:07 +0000 (17:31 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 12 Sep 2022 12:01:05 +0000 (05:01 -0700)
commit71cd6a0430ca2a2c44e3cf4cc9f3c96d3aef1ab7
tree748f105e56487b16d6df0e6173fe14bd460d7d62
parentc092d894265f3db590585804c30c1ae3cb7b3773
xtensa: gcc: fix builtin_apply return value

xtensa may use up to 4 registers to return a value from a function, but
recognition of only one register in the xtensa_function_value_regno_p
and missing untyped_call pattern result in that only one register is
saved by the __builtin_apply and returned by the __builtin_apply_return.

gcc/
* config/xtensa/xtensa.cc (xtensa_function_value_regno_p):
Recognize all 4 return registers.
* config/xtensa/xtensa.h (GP_RETURN_REG_COUNT): New definition.
* config/xtensa/xtensa.md (untyped_call): New pattern.
gcc/config/xtensa/xtensa.cc
gcc/config/xtensa/xtensa.h
gcc/config/xtensa/xtensa.md