https://bugs.llvm.org/show_bug.cgi?id=46034

            Bug ID: 46034
           Summary: Wrong LDRD's stack offset is generated in
                    prologue/epilogue emission
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: ARM
          Assignee: unassignedb...@nondot.org
          Reporter: victor.cam...@arm.com
                CC: llvm-bugs@lists.llvm.org, smithp...@googlemail.com,
                    ties.st...@arm.com

Created attachment 23519
  --> https://bugs.llvm.org/attachment.cgi?id=23519&action=edit
Input file

Commit 8a12553223180246eeafaa0fa7bfa11e834d34b6 introduced an optimization
where volatile i64 loads and stores are translated into LDRDs and STRDs instead
of pairs of LDRs and STRs.

However, it has been reported that, in some specific cases, LLVM generates
erroneous offsets for loads that access stack objects.

>From what I could find out by investigating, the patch did not introduce this
bug. It only made it emerge elsewhere.

Comparing CodeGen's debug outputs with and without the optimization, apart from
a minor difference in instruction scheduling, the real difference takes place
in Prologue/Epilogue emission, where the stack offset generated in the two
versions differ wildly.

This observation points out to Prologue/Epilogue Emission as the likely
culprit.

The mentioned patch has since been reverted while this bug remains outstanding.

To reproduce:
clang -O0 -target armv7a-cros-linux-gnueabihf -mthumb nacl_test.i -S

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to