This is the mail archive of the gcc@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]
Other format: [Raw text]

Special assembler local variables declaration format


Hi everybody,

In my effort to port GCC to our Smartcard architecture, I'm facing a
problem which is probably not common due to our assembler format.

Take the following C function:
void foo()
{
   char a = 1, b = 2, c = 3;
  
   ...
}

The generated code of the function should be something like:
foo:
  .Local CardByte _l0
  .Local CardByte _l1
  .Local CardByte _l2
  _l0 <- 1
  _l1 <- 2
  _l2 <- 3

That is, we don't use a frame pointer at all for local variables -
instead they are explicitely declared and have to be named.

The problem is that I can't find a way to get details about the local
variables needed by a function. FUNCTION_PROLOGUE seems usefull to
output these declarations, but unfortunately it only provides the amount
of bytes needed for the local variables. And I'd need to know their
number and size.

If I could get this information, I could probably then replace
frame-pointer indexed accesses by the corresponding local variable name,
depending on whether the frame pointer is used anywhere else. But how
can I get this information to output the correct local statements? Is my
approach right for doing so? (using the frame pointer to "emulate" the
locals?) Is there a way for me to get more accurate information about
the local variables, in order to store it somewhere and output it when
needed?

Thanks for any help or information,
Alex.
-- 
http://www.gnurou.org



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