[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 5 00:30:38 PST 2024
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/116843 at github.com>
nikic wrote:
It looks like this still fails on i386 after the reapply:
```
RUN: at line 1: /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/llvm/redhat-linux-build/bin/clang -cc1 -internal-isystem /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/llvm/redhat-linux-build/bin/../lib/clang/20/include -nostdsysteminc -verify=expected,both -std=c++2a -fsyntax-only -fexperimental-new-constant-interpreter /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp
+ /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/llvm/redhat-linux-build/bin/clang -cc1 -internal-isystem /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/llvm/redhat-linux-build/bin/../lib/clang/20/include -nostdsysteminc -verify=expected,both -std=c++2a -fsyntax-only -fexperimental-new-constant-interpreter /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp
error: 'both-error' diagnostics seen but not expected:
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 26: static assertion failed due to requirement 'sizeof(bits<31, long long, 0>) == sizeof(R)'
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 27: size of '__builtin_bit_cast' source type 'const R' does not match destination type 'bits<31, long long>' (8 vs 4 bytes)
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 349: constexpr variable 't' must be initialized by a constant expression
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 350: static assertion expression is not an integral constant expression
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 37: no matching function for call to 'bit_cast'
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 352: static assertion expression is not an integral constant expression
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 26: static assertion failed due to requirement 'sizeof(R) == sizeof(bits<31, long long, 0>)'
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 27: size of '__builtin_bit_cast' source type 'const bits<31, long long>' does not match destination type 'R' (4 vs 8 bytes)
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 37: no matching function for call to 'bit_cast'
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 353: static assertion expression is not an integral constant expression
error: 'both-note' diagnostics seen but not expected:
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 349: in instantiation of function template specialization 'bit_cast<bits<31, long long>, R>' requested here
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 26: expression evaluates to '4 == 8'
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 50: initializer of 't' is not a constant expression
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 350: in call to 't.operator==(((68719476728LL << 28) | 1254162414))'
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 349: declared here
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 352: in instantiation of function template specialization 'round_trip<bits<31, long long>, R>' requested here
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 25: candidate template ignored: substitution failure [with To = bits<31, long long>, From = R]
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 37: in instantiation of function template specialization 'bit_cast<R, bits<31, long long>>' requested here
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 353: in instantiation of function template specialization 'round_trip<R, bits<31, long long>>' requested here
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 26: expression evaluates to '8 == 4'
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 353: in instantiation of function template specialization 'round_trip<R, bits<31, long long>>' requested here
File /builddir/build/BUILD/llvm-20.0.0_pre20241205.gb86a5993bc7be5-build/llvm-project-b86a5993bc7be59b49879a0e768f53b7330f71b2/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp Line 25: candidate template ignored: substitution failure [with To = bits<31, long long>, From = R]
22 errors generated.
```
https://github.com/llvm/llvm-project/pull/116843
More information about the cfe-commits
mailing list