This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
split_complex_* flaw
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc at gcc dot gnu dot org
- Cc: Aldy Hernandez <aldyh at redhat dot com>
- Date: Sat, 31 Jan 2004 21:11:33 +1030
- Subject: split_complex_* flaw
There is a fundamental design flaw in the complex arg splitting code.
Consider _Complex float on powerpc64 linux.
a) It is laid out in the parameter save area of memory as two adjacent
32 bit words, ie. in one doubleword.
b) It is passed to a function in two consecutive fp regs if fp regs
haven't been exhausted by prior args, and it doesn't correspond to
the variable part of a stdarg function.
c) It is passed to a function as laid out in the parameter save area if
it's in the variable part of a stdarg function, or if fp regs have
been exhausted. The first 8 doublewords of the parameter save area
are passed in gp regs, the rest is passed on the stack.
d) In the case of a function without a prototype, it's passed both as
for (b) and (c).
Two adjacent float args are laid out in the parameter save area in
separate doublewords.
This difference is why gcc.dg/complex-1 is failing on powerpc64-linux.
I don't see any way to fix this problem without throwing out the whole
complex arg splitting code.
--
Alan Modra
IBM OzLabs - Linux Technology Centre