The current definition of TARGET_PROMOTE_PROTOTYPES on the SPARC is: static bool sparc_promote_prototypes (const_tree fntype ATTRIBUTE_UNUSED) { return TARGET_ARCH32 ? true : false; }
As Jorge pointed out, in 32-bit mode this generates extensions of the argument registers in the callee that are redundant, at least according to the latest version (3rd) of the psABI: it says that the argument registers are already extended by the caller if there is a prototype. Therefore, Jorge suggests that we return false in 32-bit mode too (this is PR target/46208). Ironically enough, returning true in 32-bit mode is partly used to implement the psABI; you cannot simply toggle the return value, further adjustments are needed to compensate. But this should ultimately work, as in 64-bit mode. Are there still any good reasons to keep the old setting at this point? -- Eric Botcazou