This is the mail archive of the 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]

Re: Changing the frame layout of H8 port to reduce code size

In message <>
   Kazu Hirata writes:
>I am thinking about changing the frame layout of H8 port to reduce
>code size and would like to ask for comments.  Currently, the frame
>layout used in h8300-{elf,hms}-gcc looks like

[... snip current method ...]

>with the stack pointer pointing to the stack location containing the
>last saved register.  I am proposing to flip the order of the locals
>and the saved registers like so
>  argument
>    :
>  argument
>  program counter
>  frame pointer (can be omitted)
>  saved register
>    :
>  saved register
>  local
>    :
>  local          <- sp

[.. snip examples.. ]

>A quick test with uClinux for H8 shows that all the object files
>shrink or retain the same size.

For me a desirable effect, also for those wanting to do applications
in smaller processors like the H8/Tiny.

>Any comments?  You won't be affected unless your application digs up
>the stack upward.  Otherwise, you're in trouble.  If that's the case,
>I'll refrain from checking in the above change or add a switch to go
>back to the old layout (or a switch to enable the new layout).  Note
>that I am not changing the calling conventions, so linking code
>compiled with different versions of GCC would be OK.

My thoughts are that this is a better layout, and agree with your
observations above.

I would suggest a switch for old method to be deprecated later, unless
someone protests vehemently.

My vote is for the change, with a switch if somebody has need for it.
Otherwise consider no switch, but keep older version available for now.

Paul Carpenter		|
<>        Main Site
<>          Robot Wars entry using H8 and GNUH8
<>              GNU H8 & mailing list info
<>         Reading SME Business Club info
<>             For those web sites you hate

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