Re: Setting up alpha stack frames (Len)
14 May 2003 00:43:45 -0400

          From comp.compilers

Related articles
Setting up alpha stack frames (2003-05-06)
Re: Setting up alpha stack frames (2003-05-14)
Re: Setting up alpha stack frames (Peter \Firefly\Lund) (2003-05-14)
Re: Setting up alpha stack frames (2003-05-14)
| List of all articles for this month |

From: (Len)
Newsgroups: comp.compilers,comp.arch
Date: 14 May 2003 00:43:45 -0400
Organization: The Internet MainStreet, Inc.
References: 03-05-046
Keywords: architecture
Posted-Date: 14 May 2003 00:43:45 EDT

On 6 May 2003 19:18:05 -0400, Timothy Jones <> wrote:
>Hi all,
>I'm having some trouble adding an instruction (even if it's a nop) to
>the start of a procedure before the stack frame is initialised. I want
>to put it here because I want it to go before any other instruction is
>executed in each basic block.
>The first problem I had was with alignment. I started with the
>following code, where hello is the name of a simple procedure which
>prints "Hello World!". I added the nop at the start and get this
> nop
> ldgp $gp,0($27)

$27 has the address of hello in it per Alpha calling convention.
ldgp loads $gp based on this address and some PC relative operation.
See what's going to happen? $gp will be off by 4. Two nops should
"hide" the alignment problem but still leave you with an invalid $gp
now off by 8. This is from memory so don't quote me. I suggest you
single step with and without the no-op to verify this.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.