This is the mail archive of the
mailing list for the GCC project.
Re: arm/thumb bugs
- To: gcc <gcc at gcc dot gnu dot org>
- Subject: Re: arm/thumb bugs
- From: Adrian von Bidder <avbidder at acter dot ch>
- Date: Mon, 12 Nov 2001 18:15:19 +0100
- References: <3BEFDE95.DF1F7013@acter.ch>
Adrian von Bidder wrote:
> - in very big functions with long case statements, I get 'Branch out of
> range' when compiling for thumb with -fpic. I'm attempting to fix this,
> only I have no idea where to start - any hints? - since I don't know any
Quite helpless on this... I hoped I would find something looking hard at
gcc source, but to no avail...
I thought about tinkering with CASE_VECTOR_MODE, but I don't think it's
the right way. (And I would have no idea what mode to use...)
The switch statements translate to code like
ldr r2, .L20
lsl r3, r3, #2
ldr r0, [r3, r2]
mov pc, r0
when compiling with -fpic. On thumb, the branch only takes +/- 2040
bytes as addresses, so branches out of that range are generated quite
fast in big functions.
Any help available at all?
greets from Zürich