diff options
author | Jinsong Ji <jinsong.ji@intel.com> | 2025-01-14 15:46:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-14 15:46:27 -0500 |
commit | 8d1d67ec4dc957ce15a06f782c6746281e66e559 (patch) | |
tree | 926dec3571901a6e1dbe7f53d6e1806671dffcb2 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 43491f0e9594b55a79ba775daed598cd37fc3cad (diff) | |
download | llvm-8d1d67ec4dc957ce15a06f782c6746281e66e559.zip llvm-8d1d67ec4dc957ce15a06f782c6746281e66e559.tar.gz llvm-8d1d67ec4dc957ce15a06f782c6746281e66e559.tar.bz2 |
[Offload][PGO] Fix dump of array in ProfData (#122039)
Exposed by -Warray-bounds:
In file included from
../../../../../../../llvm/offload/plugins-nextgen/common/src/GlobalHandler.cpp:252:
../../../../../../../llvm/llvm/include/llvm/ProfileData/InstrProfData.inc:109:1:
error: array index 4 is past the end of the array (that has type 'const
std::remove_const<const uint16_t>::type[4]' (aka 'const unsigned
short[4]')) [-Werror,-Warray-bounds]
109 | INSTR_PROF_DATA(const uint16_t, Int16ArrayTy,
NumValueSites[IPVK_Last+1], \
| ^ ~~~~~~~~~~~
../../../../../../../llvm/offload/plugins-nextgen/common/src/GlobalHandler.cpp:250:15:
note: expanded from macro 'INSTR_PROF_DATA'
250 | outs() << ProfData.Name << " "; \
| ^ ~~~~
../../../../../../../llvm/llvm/include/llvm/ProfileData/InstrProfData.inc:109:1:
note: array 'NumValueSites' declared here
109 | INSTR_PROF_DATA(const uint16_t, Int16ArrayTy,
NumValueSites[IPVK_Last+1], \
| ^
../../../../../../../llvm/offload/plugins-nextgen/common/include/GlobalHandler.h:62:3:
note: expanded from macro 'INSTR_PROF_DATA'
62 | std::remove_const<Type>::type Name;
Avoid accessing out-of-bound data, but skip printing array data for now.
As there is no simple way to do this without hardcoding the
NumValueSites field.
---------
Co-authored-by: Ethan Luis McDonough <ethanluismcdonough@gmail.com>
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions