aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ELFObjectFile.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-05-31 09:25:38 +0200
committerGitHub <noreply@github.com>2024-05-31 09:25:38 +0200
commite1cc9e4eaddcc295b4e775512e33b947b1514c17 (patch)
tree31344f58b4617f40fb9a5546c15cce66935c19e9 /llvm/lib/Object/ELFObjectFile.cpp
parent63dc31b68b78bc0e5deef21b98cab72de997c471 (diff)
downloadllvm-e1cc9e4eaddcc295b4e775512e33b947b1514c17.zip
llvm-e1cc9e4eaddcc295b4e775512e33b947b1514c17.tar.gz
llvm-e1cc9e4eaddcc295b4e775512e33b947b1514c17.tar.bz2
[ConstantFold] Remove non-trivial gep-of-gep fold (#93823)
This fold is subtly incorrect, because DL-unaware constant folding does not know the correct index type to use, and just performs the addition in the type that happens to already be there. This is incorrect, since sext(X)+sext(Y) is generally not the same as sext(X+Y). See the `@constexpr_gep_of_gep_with_narrow_type()` for a miscompile with the current implementation. One could try to restrict the fold to cases where no overflow occurs, but I'm not bothering with that here, because the DL-aware constant folding will take care of this anyway. I've only kept the straightforward zero-index case, where we just concatenate two GEPs.
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions