===================================================================
@@ -7329,9 +7329,10 @@ sparc_function_value_1 (const_tree type,
mode = word_mode;
}
- /* We should only have pointer and integer types at this point. This must
- match sparc_promote_function_mode. */
+ /* We should only have pointer and integer types at this point, except with
+ -freg-struct-return. This must match sparc_promote_function_mode. */
else if (TARGET_ARCH32
+ && !(type && AGGREGATE_TYPE_P (type))
&& mclass == MODE_INT
&& GET_MODE_SIZE (mode) < UNITS_PER_WORD)
mode = word_mode;