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

Kostya Serebryany via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 27 12:36:58 PST 2017


On Mon, Feb 27, 2017 at 1:10 AM, Mikhail Strelnikov via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> 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?
>

Boost may actually have some bugs :)
https://svn.boost.org/trac/boost/ticket/12818


>
> Thanks.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170227/1043fa74/attachment.html>


More information about the cfe-dev mailing list