[llvm-bugs] [Bug 32658] New: Miscompilation in ARM backend

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 13 17:38:27 PDT 2017


http://bugs.llvm.org/show_bug.cgi?id=32658

            Bug ID: 32658
           Summary: Miscompilation in ARM backend
           Product: tools
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llc
          Assignee: unassignedbugs at nondot.org
          Reporter: jlerouge at apple.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 18285
  --> http://bugs.llvm.org/attachment.cgi?id=18285&action=edit
Reduced test case

I have been chasing a miscompilation for the past few days, ended up reducing
it to the attached bitcode.

(Update the triple for your arm platform, I have been able to repro with
thumbv7-apple-ios9.0.0 or armv7-none-linux-androideabi)

Repro steps:

$ llc -O0 -relocation-model=pic -disable-fp-elim -o main.good.s repro.ll
$ clang -arch armv7 -o main.good main.good.s

Execute on your favorite iOS/Android armv7 device:

$ ./main.good 
$ echo $?
0

$ llc -O1 -relocation-model=pic -disable-fp-elim -o main.bad.s repro.ll
$ clang -arch armv7 -o main.bad main.bad.s

Execute on your favorite iOS/Android armv7 device:

$ ./main.bad
$ echo $?
2

>From what I can tell, the fist byte of the arg buffer should be set to 0 after
the test, but in the bad case, it seems like we end up writing at offset 16
(which in the larger test where this was reduced from was causing a very nasty
corruption).

On that specific test, git bisect seems to say that the regression was
introduced by r250129, but I suspect that change is merely exposing a bug that
was already present somewhere else down the pipe.

-- 
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/20170414/d365b14b/attachment.html>


More information about the llvm-bugs mailing list