> I see that's not the problem. AFAICT from the code that deals with
> builtin_apply and builtin_return it looks like untyped_call and
> untyped_return should be doing what you expect for the code to save the
> values (a quick glance at sparc.md didn't show any problems, but...). Or
> is something else clobbering later?

Again, the problem is that apply_result_mode is now wrong for values returned 
in multi hard registers: suppose that a function returns 'long long', so 
DImode.  The canonical return register on SPARC is (reg/i:DI 8 %o0) in that 
case.  Now the reg_raw_mode of %o0 is SImode, not DImode, on SPARC 32-bit so
apply_result_mode[8] = SImode.  And, given FUNCTION_VALUE_REGNO_P,
apply_result_mode[9] = VOIDmode and size == 4.  The return value is, 
therefore, only partially reloaded.

Same for _Complex int, double and so on.

Sure, untyped_call and untyped_return can be hacked to work around this (a la 
ARM), but this would need to be done in every back-end.  So I think you 
should find another approach to fix your MIPS-specific problem, possibly by 
hacking MIPS' untyped_call and untyped_return.

-- 
Eric Botcazou

Reply via email to