[cfe-dev] [clang-cl] Slow miscompilation

Mikhail Strelnikov via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 27 01:10:54 PST 2017


Hello all,

I'm trying to compile following example:

#define BOOST_TEST_MODULE TestName
#include <boost/test/included/unit_test.hpp>

void fun()
{
    throw std::exception();
}

BOOST_AUTO_TEST_CASE(test_name)
{
    BOOST_CHECK_THROW(fun(), std::exception);
}

It checks that given function does throw an exception of given type.

On Windows the invocation:

"C:\Program Files\LLVM\bin\clang-cl.exe" "test.cpp" /O2 /Ob2 /GR
/Zc:forScope /Zc:wchar_t /MT /wd4675 /EHs -fsanitize=address
-fsanitize=undefined -D_HAS_AUTO_PTR_ETC=1 -DNDEBUG "-Iboost_1_63_0"
-Xclang -ftime-report

takes about 85 seconds to complete on my machine (normally it should
be 3 at most).

And the resulting executable outputs this:

boost/test/utils/class_properties.hpp:60:55: runtime error: load of
value 193, which is not a valid value for type 'bool'
SUMMARY: AddressSanitizer: undefined-behavior
boost/test/utils/class_properties.hpp:60:55 in

This also can't be right because it is Boost.Test, it can't have any
bugs. Right?

Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: time-report
Type: application/octet-stream
Size: 38937 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170227/0742701d/attachment.obj>


More information about the cfe-dev mailing list