https://bugs.llvm.org/show_bug.cgi?id=39146

            Bug ID: 39146
           Summary: clang-cl ignores #pragma optimize("", off), continues
                    optimizing
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: brucedaw...@chromium.org
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

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).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to