https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104274
--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
In gimplify_parameters:
x86_64:
(gdb) p data.arg
$2 = {type = <record_type 0x7fffea77cbd0 vj>, mode = E_BLKmode, named = 1,
pass_by_reference = 0}
hppa64-hpux11.3:
(gdb) p data.arg
$29 = {type = <pointer_type 0x7fffea73bbd0>, mode = E_DImode, named = 1,
pass_by_reference = 1}
so this seems to only be happening for empty structs, when passing them by
reference.
Specifically, for both targets we reach:
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Breakpoint 12, pass_by_reference (ca=0x7fffffffd860, arg=...) at
../../src/gcc/calls.cc:921
921 return targetm.calls.pass_by_reference (pack_cumulative_args (ca),
arg);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
and on pa, size == 0, so we pass by reference:
6367 static bool
6368 pa_pass_by_reference (cumulative_args_t, const function_arg_info &arg)
6369 {
6370 HOST_WIDE_INT size = arg.type_size_in_bytes ();
6371 if (TARGET_64BIT)
6372 return size <= 0;
6373 else
6374 return size <= 0 || size > 8;
6375 }
whereas on x86_64, ix86_pass_by_reference returns false.