<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 --- - -fno-builtin and -fno-builtin-foo disable optimizations that introduce builtin calls (e.g., LIR)"
   href="https://llvm.org/bugs/show_bug.cgi?id=26990">26990</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-fno-builtin and -fno-builtin-foo disable optimizations that introduce builtin calls (e.g., LIR)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mcrosier@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bob.wilson@apple.com, dexonsmith@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The -fno-builtin option says don't recognize built-in functions that do not
begin with __builtin__ as a prefix.  This is done to prevent the compiler from
optimizing such calls in the original program.  However, it isn't clear to me
(or Duncan or Bob) that this should prevent the compiler from introducing new
calls to builtin functions.

For example, this bit of code is recognized by the loop idiom pass as a memset:

void foo(int *arr) {
  for (unsigned i = 0; i < 8192; ++i)
    arr[i] = 0;
}

When compiling with gcc, the -fno-builtin and -fno-builtin-memset options don't
prevent gcc from converting this loop into a memset:

$> aarch64-linux-gnu-gcc -O3 test.c -o - -S -fno-builtin-memset | grep memset
     b    memset

However, the same is not true when compiling with LLVM.</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>