<html>
    <head>
      <base href="http://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Miscompilation in ARM backend"
   href="http://bugs.llvm.org/show_bug.cgi?id=32658">32658</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Miscompilation in ARM backend
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>llc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jlerouge@apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18285" name="attach_18285" title="Reduced test case">attachment 18285</a> <a href="attachment.cgi?id=18285&action=edit" title="Reduced test case">[details]</a></span>
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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>