[LLVMdev] LLVM 2.4 problem? (resend)
daveed at vandevoorde.com
Wed Oct 15 10:56:06 PDT 2008
On Oct 15, 2008, at 1:04 PM, Anton Korobeynikov wrote:
> Hello, David
>> (My own position is that different objects should have guaranteed
>> different addresses. To alias them, a code generator must prove that
>> it wouldn't change observable behavior.)
> However, it's pretty common linker optimization to merge constant
> strings / small literal values. So, even if compiler itself won't
> merge them, they will be emitted into mergeable section and then
> linker will perform this optimization.
Correct, but note that literals (unlike variables) don't define
distinct objects per se. For example, two occurrences of "literal"
may evaluate to the same (array) object. The standard even explicitly
allows for e.g. "literal" to be a subobject of "string
literal" (2.13.4/10 in N2723).
More information about the llvm-dev