[PATCH] D150218: [ConstantMerge] Only merge constant w/unnamed_addr

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 14:37:42 PDT 2023


efriedma added a comment.

The C standard says "It is unspecified whether these arrays are distinct provided their elements have the appropriate values."  C++ says "Whether all string-literals are distinct (that is, are stored in nonoverlapping objects) and whether successive evaluations of a string-literal yield the same or a different object is unspecified."

I suppose you could narrowly interpret the standards as only allowing string literals to overlap other string literals, but they don't explicitly say that.  And allowing string literals to overlap with other constants hasn't caused any practical issues, as far as I know.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150218/new/

https://reviews.llvm.org/D150218



More information about the llvm-commits mailing list