This is the mail archive of the gcc-patches@gcc.gnu.org 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: [PATCH: PR target/38570] remove redundant push {lr} for -mthumb


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


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