avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] May avr-gcc emit EIJMP/EICALL?


From: Boyapati, Anitha
Subject: Re: [avr-gcc-list] May avr-gcc emit EIJMP/EICALL?
Date: Thu, 13 Oct 2011 16:28:24 +0800


>-----Original Message-----
>From: address@hidden
>[mailto:address@hidden On
>Behalf Of Georg-Johann Lay
>Sent: Thursday, October 13, 2011 1:55 AM
>To: address@hidden
>Cc: Jörg Wunsch; Denis Chertykov
>Subject: [avr-gcc-list] May avr-gcc emit EIJMP/EICALL?
>
>avr-gcc currenly emits EICALL/EIJMP instructions without caring for
>EIND, e.g. avr.md:3630:
>
>(define_insn "call_insn"
>   [...]
>   ""
>   "@
>     %!icall
>     %~call %x0
>     %!ijmp
>     %~jmp %x0"
>     ...)
>
>where %! resolves to 'e' for targets with > 128k of flash.
>
>IMO that is not okay because the compiler does not care for EIND and
>even if he (or the user) did that approch is it not IRQ-save.
>

Yes. This is a bug. 'EIND' register is not set. 

Actually I have more such issues in queue:

-> 'ELPM' instruction, emitted for functions in libgcc.S do not set RAMPZ 
registers.
-> The case for generating ELPM instructions is not considered for 'tablejump' 
patterns.



>Instead, programs for big targets should use linker relaxation and jump
>to the generated jumping pad by means of IJMP/ICALL instead.
>
>Thoughts?

But this works only when the range is below 128K bytes. EIJMP/EICALL are 
required beyond that. I think a proper fix will be to generate {EIND, 
EIJMP/EICALL} instructions and then apply relaxation.


Anitha



reply via email to

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