[PATCH] Fix return sequence on armv4 thumb

Renato Golin renato.golin at linaro.org
Thu Jul 31 15:47:23 PDT 2014


On 31 July 2014 21:24, Jonathan Roelofs <jonathan at codesourcery.com> wrote:
> Currently the return sequence we generate for thumb functions without
> varargs is something like this:
>
>    pop {r7, pc}
>
> which works on v5t and later processors. Unfortunately, this doesn't work on
> armv4t. According to
> http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Cihfddaf.html,
> pop does not change the arm/thumb state on armv4. This means that we can't
> use it to return from functions that we expect to be interworking-safe.

Hi Jon,

Ouch, I thought we were doing it already... I guess nobody tests pre-v5. :)


> Attached is a patch that fixes this behavior.

Can you submit it to Phabricator? Make sure to create your patch with
-U999, so that it's easy to widen the context up and down and to make
the review a lot easier.

thanks,
--renato



More information about the llvm-commits mailing list