SH-ELF: SFmode calling convention bug with -m4/-m4-single-only -ml

Joern Rennecke amylaar@onetel.net.uk
Wed Oct 31 17:50:00 GMT 2001


> The culprit appears to be the FUNCTION_ARG macro in gcc/config/sh/sh.h.
> It flips the least significant bit of the regno to which the parameter
> is assigned if the options are -m4/-m4-single and -ml.

This bit flipping is necessary because DFmode values are always big endian
in registers, but in little endian mode they are little endian in memory.
So when a varargs function stores the floating point registers, it stores
fr5 first in memory, then fr4, then fr7, then fr6 etc.
If you wanted to use the fp registers in numerical order for SFmode in
little endian mode, you'd need larger and slower code in the va_arg
processing.

-- 
Joern Rennecke                  |            gcc expert for hire
amylaar@onetel.net.uk           |  send enquiries to: jwr_jobs@onetel.net.uk



More information about the Gcc-bugs mailing list