https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101718
Iain Sandoe <iains at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |iains at gcc dot gnu.org Status|NEW |ASSIGNED --- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> --- Created attachment 51310 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51310&action=edit trial fix So it seems that the logic was slightly off, but in a way that would not fire unless a non-aggregate return-in-memory occurred, and those are very rare (non-existent, with the clang ABI) for Darwin which is the only NeXT v2 user with test coverage. the change is: if (ret_type && !VOID_TYPE_P (ret_type) && targetm.calls.return_in_memory (ret_type, 0) && !(targetm.calls.struct_value_rtx (0, 0) && (TREE_CODE (ret_type) == RECORD_TYPE || TREE_CODE (ret_type) == UNION_TYPE))) So this says, "if there's a return value and it's returned in memory and the target makes no special provision for returning aggregates then use the _stret versions". Probably some scope for factoring some of that code - but bug fixes first. Does this work for your platform?