Skip to content

DependencyTracker.cpp fails to build on error: static assertion failed due to requirement '3U <= PointerLikeTypeTraits<llvm::dwarflinker_parallel::CompileUnit *>::NumLowBitsAvailable': PointerIntPair with integer size too large for pointer #73267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sylvestre opened this issue Nov 23, 2023 · 4 comments

Comments

@sylvestre
Copy link
Collaborator

On linux debian i386 with 7f215b1:

/opt/sccache//sccache /build/source/build-llvm/./bin/clang++ -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/build/source/build-llvm/tools/clang/stage2-bins/lib/DWARFLinkerParallel -I/build/source/llvm/lib/DWARFLinkerParallel -I/build/source/build-llvm/tools/clang/stage2-bins/include -I/build/source/llvm/include -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -ffile-prefix-map=/build/source/build-llvm/tools/clang/stage2-bins=build-llvm/tools/clang/stage2-bins -ffile-prefix-map=/build/source/= -no-canonical-prefixes -O2 -DNDEBUG -g1 -std=c++17  -fno-exceptions -funwind-tables -MD -MT lib/DWARFLinkerParallel/CMakeFiles/LLVMDWARFLinkerParallel.dir/DependencyTracker.cpp.o -MF lib/DWARFLinkerParallel/CMakeFiles/LLVMDWARFLinkerParallel.dir/DependencyTracker.cpp.o.d -o lib/DWARFLinkerParallel/CMakeFiles/LLVMDWARFLinkerParallel.dir/DependencyTracker.cpp.o -c /build/source/llvm/lib/DWARFLinkerParallel/DependencyTracker.cpp
In file included from /build/source/llvm/lib/DWARFLinkerParallel/DependencyTracker.cpp:9:
In file included from /build/source/llvm/lib/DWARFLinkerParallel/DependencyTracker.h:12:
In file included from /build/source/llvm/lib/DWARFLinkerParallel/DWARFLinkerCompileUnit.h:12:
In file included from /build/source/llvm/lib/DWARFLinkerParallel/DWARFLinkerUnit.h:12:
In file included from /build/source/llvm/lib/DWARFLinkerParallel/DWARFLinkerGlobalData.h:12:
In file included from /build/source/llvm/lib/DWARFLinkerParallel/TypePool.h:15:
In file included from /build/source/llvm/include/llvm/CodeGen/DIE.h:17:
/build/source/llvm/include/llvm/ADT/PointerIntPair.h:172:17: error: static assertion failed due to requirement '3U <= PointerLikeTypeTraits<llvm::dwarflinker_parallel::CompileUnit *>::NumLowBitsAvailable': PointerIntPair with integer size too large for pointer
  172 |   static_assert(IntBits <= PtrTraits::NumLowBitsAvailable,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/source/llvm/include/llvm/ADT/PointerIntPair.h:103:13: note: in instantiation of template class 'llvm::PointerIntPairInfo<llvm::dwarflinker_parallel::CompileUnit *, 3, llvm::PointerLikeTypeTraits<llvm::dwarflinker_parallel::CompileUnit *>>' requested here
  103 |     Value = Info::updateInt(Value, static_cast<intptr_t>(IntVal));
      |             ^
/build/source/llvm/lib/DWARFLinkerParallel/DependencyTracker.h:138:14: note: in instantiation of member function 'llvm::PointerIntPair<llvm::dwarflinker_parallel::CompileUnit *, 3>::setInt' requested here
  138 |       RootCU.setInt(static_cast<uint8_t>(Action));
      |              ^
/build/source/llvm/include/llvm/ADT/PointerIntPair.h:172:25: note: expression evaluates to '3 <= 2'
  172 |   static_assert(IntBits <= PtrTraits::NumLowBitsAvailable,
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/source/llvm/include/llvm/ADT/PointerIntPair.h:103:17: error: incomplete definition of type 'llvm::PointerIntPairInfo<llvm::dwarflinker_parallel::CompileUnit *, 3, llvm::PointerLikeTypeTraits<llvm::dwarflinker_parallel::CompileUnit *>>'
  103 |     Value = Info::updateInt(Value, static_cast<intptr_t>(IntVal));
      |             ~~~~^~
/build/source/llvm/lib/DWARFLinkerParallel/DependencyTracker.h:138:14: note: in instantiation of member function 'llvm::PointerIntPair<llvm::dwarflinker_parallel::CompileUnit *, 3>::setInt' requested here
  138 |       RootCU.setInt(static_cast<uint8_t>(Action));
      |              ^
@llvmbot
Copy link
Member

llvmbot commented Nov 24, 2023

@llvm/issue-subscribers-debuginfo

Author: Sylvestre Ledru (sylvestre)

On linux debian i386 with 7f215b1: ``` /opt/sccache//sccache /build/source/build-llvm/./bin/clang++ -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/build/source/build-llvm/tools/clang/stage2-bins/lib/DWARFLinkerParallel -I/build/source/llvm/lib/DWARFLinkerParallel -I/build/source/build-llvm/tools/clang/stage2-bins/include -I/build/source/llvm/include -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -ffile-prefix-map=/build/source/build-llvm/tools/clang/stage2-bins=build-llvm/tools/clang/stage2-bins -ffile-prefix-map=/build/source/= -no-canonical-prefixes -O2 -DNDEBUG -g1 -std=c++17 -fno-exceptions -funwind-tables -MD -MT lib/DWARFLinkerParallel/CMakeFiles/LLVMDWARFLinkerParallel.dir/DependencyTracker.cpp.o -MF lib/DWARFLinkerParallel/CMakeFiles/LLVMDWARFLinkerParallel.dir/DependencyTracker.cpp.o.d -o lib/DWARFLinkerParallel/CMakeFiles/LLVMDWARFLinkerParallel.dir/DependencyTracker.cpp.o -c /build/source/llvm/lib/DWARFLinkerParallel/DependencyTracker.cpp In file included from /build/source/llvm/lib/DWARFLinkerParallel/DependencyTracker.cpp:9: In file included from /build/source/llvm/lib/DWARFLinkerParallel/DependencyTracker.h:12: In file included from /build/source/llvm/lib/DWARFLinkerParallel/DWARFLinkerCompileUnit.h:12: In file included from /build/source/llvm/lib/DWARFLinkerParallel/DWARFLinkerUnit.h:12: In file included from /build/source/llvm/lib/DWARFLinkerParallel/DWARFLinkerGlobalData.h:12: In file included from /build/source/llvm/lib/DWARFLinkerParallel/TypePool.h:15: In file included from /build/source/llvm/include/llvm/CodeGen/DIE.h:17: /build/source/llvm/include/llvm/ADT/PointerIntPair.h:172:17: error: static assertion failed due to requirement '3U <= PointerLikeTypeTraits<llvm::dwarflinker_parallel::CompileUnit *>::NumLowBitsAvailable': PointerIntPair with integer size too large for pointer 172 | static_assert(IntBits <= PtrTraits::NumLowBitsAvailable, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /build/source/llvm/include/llvm/ADT/PointerIntPair.h:103:13: note: in instantiation of template class 'llvm::PointerIntPairInfo<llvm::dwarflinker_parallel::CompileUnit *, 3, llvm::PointerLikeTypeTraits<llvm::dwarflinker_parallel::CompileUnit *>>' requested here 103 | Value = Info::updateInt(Value, static_cast<intptr_t>(IntVal)); | ^ /build/source/llvm/lib/DWARFLinkerParallel/DependencyTracker.h:138:14: note: in instantiation of member function 'llvm::PointerIntPair<llvm::dwarflinker_parallel::CompileUnit *, 3>::setInt' requested here 138 | RootCU.setInt(static_cast<uint8_t>(Action)); | ^ /build/source/llvm/include/llvm/ADT/PointerIntPair.h:172:25: note: expression evaluates to '3 <= 2' 172 | static_assert(IntBits <= PtrTraits::NumLowBitsAvailable, | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /build/source/llvm/include/llvm/ADT/PointerIntPair.h:103:17: error: incomplete definition of type 'llvm::PointerIntPairInfo<llvm::dwarflinker_parallel::CompileUnit *, 3, llvm::PointerLikeTypeTraits<llvm::dwarflinker_parallel::CompileUnit *>>' 103 | Value = Info::updateInt(Value, static_cast<intptr_t>(IntVal)); | ~~~~^~ /build/source/llvm/lib/DWARFLinkerParallel/DependencyTracker.h:138:14: note: in instantiation of member function 'llvm::PointerIntPair<llvm::dwarflinker_parallel::CompileUnit *, 3>::setInt' requested here 138 | RootCU.setInt(static_cast<uint8_t>(Action)); | ^ ```

@mgorny
Copy link
Member

mgorny commented Nov 25, 2023

This was broken in b61ac4a; CC @avl-llvm.

@avl-llvm
Copy link
Collaborator

thanks, will integrate a fix or revert.

@avl-llvm avl-llvm self-assigned this Nov 25, 2023
avl-llvm added a commit that referenced this issue Nov 25, 2023
This fixes usage of PointerIntPair on 32-bit platform -
#73267.
@thesamesam
Copy link
Member

thesamesam commented Nov 30, 2023

Fixed I think? Thank you!

felipepiovezan pushed a commit to felipepiovezan/llvm-project that referenced this issue Feb 2, 2024
This fixes usage of PointerIntPair on 32-bit platform -
llvm#73267.

(cherry picked from commit 6b708cc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants