[llvm] [ConstantMerge] Only merge constant w/unnamed_addr (PR #124050)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 23 16:07:39 PST 2025
efriedma-quic wrote:
Okay, that's what I expected: pointer subtraction like that only works if both symbols are "local" (in the ELF sense). ConstantMerge isn't aware of the pointer subtraction, so it blindly merges without checking for that.
unnamed_addr is a red herring: unnamed_addr is correlated with symbol linkage for C strings work, but it's not directly connected to the issue. clang generates unnamed_addr variables with defualt linkage in some cases.
https://github.com/llvm/llvm-project/pull/124050
More information about the llvm-commits
mailing list