<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - optnone causes CodeGen crash on ARM" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23684&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=X7ITrzMnRMuqvBvkkr-FfZ9Rkym7RBDxjZtswBDsiIs&s=jA3V-7H0RaIavZPplRGh21BZoY1oZeHorFc5sizevRU&e=">23684</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>optnone causes CodeGen crash on ARM
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </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>mail+llvm@tzik.jp
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14399" name="attach_14399" title="crash log">attachment 14399</a> <a href="attachment.cgi?id=14399&action=edit" title="crash log">[details]</a></span>
crash log

On LLVM r238172 and Clang r238166, following code causes clang crash:
$ clang -fPIC -target arm-linux-gnueabi -O1 -x c -o /dev/null - 2>>
crash-log.txt <<EOF

int i = 0;

void g(int* x) {
  *x = 0;
}

__attribute__((optnone))
void f() {
  g(&i);
}
EOF

And in IR, this also causes crash:
$ clang -fPIC -target arm-linux-gnueabi -O1 -x ir -o /dev/null - 2>>
crash-log.txt <<EOF

target triple = "armv4t--linux-gnueabi"
@i = global i32 0, align 4

define void @g(i32* %x) {
  store i32 0, i32* %x, align 4
  ret void
}

define void @f() noinline optnone {
  call void @g(i32* @i)
  ret void
}
EOF</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>