[clang-cl] Slow miscompilation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[clang-cl] Slow miscompilation

Jacob Carlborg via cfe-dev
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.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

time-report (52K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [clang-cl] Slow miscompilation

Jacob Carlborg via cfe-dev


On Mon, Feb 27, 2017 at 1:10 AM, Mikhail Strelnikov via cfe-dev <[hidden email]> 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 :) 
 

Thanks.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...