[LLVMbugs] [Bug 15444] New: std::bitset<63> test fails on 32 bit target

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 4 21:00:20 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=15444

            Bug ID: 15444
           Summary: std::bitset<63> test fails on 32 bit target
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: hhinnant at apple.com
          Reporter: bruce.mitchener at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

If you modify testit to pass "-O2 -arch i386" when building tests, you get some
failures that don't happen when targeting -arch x86_64:

passed 2 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset
Assertion failed: (v[i] == (i & 1)), function test_val_ctor, file
ull_ctor.pass.cpp, line 25.
./testit: line 90: 38754 Abort trap: 6           ./$TEST_EXE
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
failed at run time
Compile line was: xcrun clang++ -std=c++0x -stdlib=libc++ -arch i386 -O2
-I/Users/bruce/Development/libcxx/test/support
-I/Users/bruce/Development/libcxx/include -L/Users/bruce/Development/libcxx/lib
ull_ctor.pass.cpp
failed 1 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.cons
passed 3 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.cons
passed 1 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.hash
Assertion failed: (j == v.to_ullong()), function test_to_ullong, file
to_ullong.pass.cpp, line 35.
./testit: line 90: 38896 Abort trap: 6           ./$TEST_EXE
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
failed at run time
Compile line was: xcrun clang++ -std=c++0x -stdlib=libc++ -arch i386 -O2
-I/Users/bruce/Development/libcxx/test/support
-I/Users/bruce/Development/libcxx/include -L/Users/bruce/Development/libcxx/lib
to_ullong.pass.cpp
failed 1 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.members
passed 25 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.members
passed 5 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.operators

While I reproduced this on Mac OS X (Mountain Lion), I initially found it when
porting the current version of libcxx to run with emscripten which targets a 32
bit processor.

The problem appears (to me) to be due to the 64 bit store for the "unsigned
long long" initial value being truncated to a 32 bit value (by inspecting the
LLVM IR). This seems to happen during the SROA pass, but it wasn't clear to me
if perhaps this was due to __first_ having an invalid type, since it is an
array of size_type  so a 64 bit value shouldn't be stored into it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130305/fd374921/attachment.html>


More information about the llvm-bugs mailing list