This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH: PR target/38570] remove redundant push {lr} for -mthumb
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Carrot Wei <carrot at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 04 May 2009 15:41:43 -0700
- Subject: Re: [PATCH: PR target/38570] remove redundant push {lr} for -mthumb
- References: <7587b290905032003h4973b82cmac9d6100abf17d7e@mail.gmail.com>
Carrot Wei wrote:
> The fix first compute the maximum possible function length, if the length is
> not large enough far jump is not necessary, and we can do this optimization
> safely.
That's a clever idea. However, when doing this kind of thing you always
have to watch out for asm instructions -- the compiler can't estimate
their length. So, we should not do this optimization for functions
containing an "asm". Also, is reload late enough in the game to be sure
that no additional instructions will be inserted?
Finally, your new constant (SHORTEST_FAR_JUMP_LENGTH) needs a detailed
comment. Please make sure you consider any differences between ARM,
Thumb, and Thumb-2 modes; we should be careful that this distance
doesn't need to be different between the modes.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713