[PATCH] Fix return sequence on armv4 thumb

Jonathan Roelofs jonathan at codesourcery.com
Thu Jul 31 15:52:32 PDT 2014



On 7/31/14, 4:47 PM, Renato Golin wrote:
> 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. :)
Yeah... :/
>
>
>> 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.
Sure: http://reviews.llvm.org/D4748

Cheers,
Jon
>
> thanks,
> --renato
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the llvm-commits mailing list