[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] mcall-prologues completely broken for >128k

From: Sean D'Epagnier
Subject: [avr-gcc-list] mcall-prologues completely broken for >128k
Date: Sat, 9 May 2009 13:36:21 -0600

Hi,  I originally thought my extensive used of the gcc extension
"Address labels" was the cause of my problems.  After inspection of
the assembly I realized that they worked perfectly via the trampoline
mechanism..  so what was the problem?

I found that prologue_saves calls eijmp at the end, which makes sense,
it gets back to the function it was in.  However, the EIND register is
not set which means it jumps to the wrong section if the function was
in the upper section.

I verified it by recompiling everything (including avr-libc) without
-mcall_prologues and the program seems to run.. (before there was no

This issue is pretty easy to fix.. I can set EIND before jumping to
prologue_saves.. but this would break when the next eijmp or eicall
instruction is executed  if I don't set EIND back to 0.

The thing confusing me the most right now, is why gcc currently emits
eijmp or eicall at all.  Since EIND is _never_ set, why did someone go
to all the trouble to make gcc emit eijmp and eicall?  I want to
change gcc to use ijmp and icall always.. then in libgcc.S use eijmp,
and set EIND in prologue_saves and I won't have to bother restoring

If I'm confused about something, or there is a better explanation, let
me know.  I'm going to modify gcc and have a patch for this soon.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]