<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 - clang-cl ignores #pragma optimize("", off), continues optimizing"
   href="https://bugs.llvm.org/show_bug.cgi?id=39146">39146</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-cl ignores #pragma optimize("", off), continues optimizing
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>brucedawson@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>A handy technique when working on optimized builds is to disable optimizations
for a single source file or function by adding this to the source:

#pragma optimize("", off)

With clang-cl this seems to be silently ignored - functions are still inlined
and become undebuggable. The desired effect can be obtained with this:

#pragma clang optimize off

However, if clang-cl is trying to maintain the semantics of cl.exe then it
needs to support #pragma optimize - and __pragma(optimize... - to avoid the
need for source-code changes.

Chrome's repo has about 35 instances of #pragma optimize("", off), and a couple
of instances of #pragma optimize("g", off). Some of these are bogus and should
be removed, but the compiler should still support the construct, or warn if it
is being ignored (maybe warn on unsupported variants).</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>