<html>
    <head>
      <base href="https://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 - Labels generated, but no code above 'O0'"
   href="https://bugs.llvm.org/show_bug.cgi?id=35508">35508</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Labels generated, but no code above 'O0'
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>martino@theheart.ie
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>While reducing a bug in my LLVM Out-of-Tree sources (v5.0.0), I discovered that
the same problem occurs with the official v4.0.0 and v5.0.0 X86 distributions
for Windows and Linux.

When the following example is compiled with 'clang -S -O0' code is correctly
generated, but with '-O1' and above, only labels are generated with no code
following.  No error is reported and the exit code is zero.

The minimal test case I could reduce to is as follows:

  void func(int *z) {
    int *b = 0;

    for (int j = 0; j < 16; j++) {
      int c = *b;
      c -= *z++;
      *b++ = c;
    }
  }

For X86 this produces only the following code (nothing after "# BB#0:"):

      .text
      .def     @feat.00;
      .scl    3;
      .type   0;
      .endef
      .globl  @feat.00
  @feat.00 = 1
      .def     _func;
      .scl    2;
      .type   32;
      .endef
      .globl  _func
      .p2align    4, 0x90
  _func:                                  # @func
  # BB#0:</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>