[PATCH] D63677: [ARM] Don't reserve R12 on Thumb1 as an emergency spill slot.

Oliver Stannard (Linaro) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 02:43:08 PDT 2019


ostannard added a comment.

I've reduced one of the failures from my fuzzer (with this patch applied on top of SVN r364172) to P8154 <https://reviews.llvm.org/P8154>, and it looks like we're now using the base pointer before it has been set up:

  $ /work/llvm/build/bin/clang --target=arm--none-eabi -march=armv6-m -c file2097315.c -O0 -o - -S
  ...
  F1214777307:
        .fnstart
        .save   {r4, r5, r6, r7, lr}
        push    {r4, r5, r6, r7, lr}
        .setfp  r7, sp, #12
        add     r7, sp, #12
        str     r2, [r6, #28]
        .pad    #1548
        ldr     r2, .LCPI0_1
        add     sp, r2
        mov     r4, sp
        lsrs    r4, r4, #5
        lsls    r4, r4, #5
        mov     sp, r4
        mov     r6, sp
  ...

The third instruction in the function looks like it is using r6 as the base pointer to save one of the argument registers on the stack, but r6 isn't set until further down.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63677/new/

https://reviews.llvm.org/D63677





More information about the llvm-commits mailing list