This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ppc AIX vararg patch


	I do not think that this patch is correct or wise.  GCC should
match the AIX calling convention.  I can send you the dicussions that
Jeff, Wilson, Kenner, and Joern had about this back in 1997.

	GCC has ignored the definition of FUNCTION_ARG_PADDING in some
instances because it originally could not pass certain types of values in
registers.  This is what expr.h:MUST_PASS_IN_STACK() macro encodes.  It is
not encoding what a port wants passed in the stack, but what the GCC
backend cannot (could not!) pass in registers.  This overriding definition
causes function.c and calls.c to do the wrong thing.

	GCC could be converted to obey FUNCTION_ARG_PADDING(), but the
argument against it is the number of embedded architectures for which GCC
actually defined the ABI -- and defined it in this broken manner.  The way
that most ports seem to get around it is to make FUNCTION_ARG return a
PARALLEL and then use emit_group_load() / emit_group_store() to handle the
partial word padding correctly.  I really think that the GCC ports should
be fixed to define their broken ABI instead of relying upon incorrect GCC
behavior, but I have not had the time or energy to fix this.

	These regressions began when Wilson "fixed" Irix5 support in late
Fall 1997.  Fixing Irix5 broke AIX and vice versa.  As Wilson said during
the discussion in 1997: "There are a great many places that do not use
FUNCTION_ARG_PADDING but should.  It will be hard to find all of them, but
we do need to find them all if we want to get structure passing working
correctly for all targets."

	This is an extremely subtle and delicate part of GCC, so please do
not apply quick fixes that cover up the problem.

David
===============================================================================
David Edelsohn                                      T.J. Watson Research Center
dje@watson.ibm.com                                  P.O. Box 218
+1 914 945 4364 (TL 862)                            Yorktown Heights, NY 10598

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]