[llvm-bugs] [Bug 46034] New: Wrong LDRD's stack offset is generated in prologue/epilogue emission

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 22 03:03:41 PDT 2020


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: unassignedbugs at nondot.org
          Reporter: victor.campos at arm.com
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com,
                    Ties.Stuij at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200522/ef6ebe28/attachment.html>


More information about the llvm-bugs mailing list