<stekern>
notice how the (64-bit) double is passed on the stack from main, but read (partially) from r8 in var_arg_f
<stekern>
the reason is that the lm32 abi doesn't split arguments between regs and stack, but the generic vararg handler in gcc can't handle that
<stekern>
that's at least how I understand it
<larsc>
I'm pretty sure that this is not lm32 specific problem
<larsc>
so I suspect there is some support for this in gcc
<stekern>
I actually stumbled on this when noticing the same bug in another (out of tree) backend that has the same ABI (not splitting args between regs and stack)
<stekern>
I think most other archs do split args
<stekern>
at least all other I have seen, that's why I wanted to find out how lm32 handles it... but it doesn't
<larsc>
I might be mistaken by thing that some require that a 64-bit value must be aligned to even register numbers
<larsc>
think
<stekern>
I guess it's solveable, but I wonder how easily (writing your own vararg handler is what comes to mind)
<larsc>
but we probably already specify somehwere that gcc should not split args between stack and regs when generating the code
<larsc>
just looking at the same define in the default stdarg handler should do it I gues
<larsc>
s
<stekern>
yes, it's specified by not (re)defining TARGET_ARG_PARTIAL_BYTES
<stekern>
the default hook is a function that return 0
Alarm has quit [Remote host closed the connection]