[Bug rtl-optimization/105023] new test case g++.dg/other/pr104989.C ICEs

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 23 16:01:16 GMT 2022


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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
BLKmode is valid mode for larger aggregate arguments and return values.
As documented:
"The return value is usually either a @code{reg} RTX for the hard
register in which to pass the argument, or zero to pass the argument
on the stack.

The value of the expression can also be a @code{parallel} RTX@.  This is
used when an argument is passed in multiple locations.  The mode of the
@code{parallel} should be the mode of the entire argument.  The
@code{parallel} holds any number of @code{expr_list} pairs; each one
describes where part of the argument is passed.  In each
@code{expr_list} the first operand must be a @code{reg} RTX for the hard
register in which to pass this part of the argument, and the mode of the
register RTX indicates how large this part of the argument is.  The
second operand of the @code{expr_list} is a @code{const_int} which gives
the offset in bytes into the entire argument of where this part starts.
As a special exception the first @code{expr_list} in the @code{parallel}
RTX may have a first operand of zero.  This indicates that the entire
argument is also stored on the stack.

The last time this hook is called, it is called with @code{MODE ==
VOIDmode}, and its result is passed to the @code{call} or @code{call_value}
pattern as operands 2 and 3 respectively."

If the whole argument is to be passed on the stack, the hook should just return
NULL_RTX.  In case the psABI says for such structures (say the one with short :
 2048 bitfield) should be partially passed in registers, still (reg:BLK 3 3)
seems to be a wrong answer, it could use (parallel:BLK [(reg:DI 3 3) (reg:DI 4
4) (reg:DI 5 5) (reg:DI 6 6)]) to indicate passing say first 256 bits in
registers and the rest on the stack.


More information about the Gcc-bugs mailing list