gcc conformance to HP-PA ABI

Jeffrey A Law law@cygnus.com
Fri Jun 30 08:30:00 GMT 2000

  In message < 200006301450.QAA27567@ubu.enst.fr >you write:
  > Hello,
  > I am currently investigating the possibility to use a hp library to unwind
  > stack frames. This library requires that the code respects some conventions
  > regarding how registers are used, where they are saved, ...
Right.  Note however that such conventions are not part of the ABI -- the
ABI is concerned with parameter passing, structure layout, caller vs called
saved register and similar items.

  > Using gcc 2.95.1 19990816 (release) on HP-UX 10.20, successful results are
  > only obtained when using the -fomit-frame-pointer option.
Odd, since -fomit-frame-pointer does _not_ save the previous stack pointer
into the frame.  

Either way, HP's unwind libraries should be able to deal with code that
does or does not have a frame pointer.  To the best of my knowledge GCC
follows the unwinder's conventions as far as the SAVE_SP directives
are concerned.

  >  Indeed, the
  > generated assembly for a simple test case shows that, when this option is
  > not provided, some SAVE_SP directives appear and sp is actually saved, but
  > not at the "conventional" place (if I understand correctly).
?!?  I think you're badly confused.  -fomit-frame-pointer will (usually)
prevent the compiler from saving the previous stack pointer into the frame.

  > Is it normal ? Did I miss something ? In case no, are there other known
  > cases in which the hp conventions may not be followed ?
The location of the callee save area is different which makes the unwinder
code unable to find callee saved registers.

This could be fixed by someone suitably interested.

  > A positive answer to the last question would mean that it will be pretty
  > hard to be able to use the library reliably.

More information about the Gcc mailing list