Applying FUNCTION_ARG_PADDING to register arguments

Jeffrey A Law law@cygnus.com
Fri Oct 24 07:43:00 GMT 1997


  In message < 199710240016.RAA27996@cygnus.com >you write:
  > 	While tracking down a varargs bug, I found that calls.c doesn't respect
  > 	FUNCTION_ARG_PADDING for register arguments.  I think that is a bug.
  > 
  > I agree.  However, the problem is not quite this simple to fix, because adding
  > code that uses FUNCTION_ARG_PADDING may break the compiler for other targets
  > if FUNCTION_ARG_PADDING happens to be defined wrong for this case.  This
  > should at least be checked.  This particular code is used for the PA and
  > Irix6 ports.  I suggest you test them with your patch.
  > 
  > The irix6 port has a related problem.  I wrote up a description of
  > this once so I could discuss the problem with Kenner, but never had time
  > to finish the work I started.   My message follows.  I don't claim that
  > everything in it is correct, but there might be some useful info in it.
There is a long standing ABI bug on the PA with regards to padding
of structs.  If I remember right, when a small struct is passed in
a reg it is incorrectly justified.

I believe this can be triggered by setting up a varargs/stdarg call
with a small structs as unnamed args.  If you compile the caller
with gcc and the callee with HP C, then they'll disagree on the value
of the parameters (similarly if you switch compiler for caller/callee).

Jeff



More information about the Gcc mailing list