<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 28, 2015 at 8:27 AM, Joerg Sonnenberger via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Aug 28, 2015 at 04:52:56PM +0200, devh8h via llvm-dev wrote:<br>
> Is there a way to prevent the optimizer to assume the two variables<br>
> are distinct ? Or what is the proper way to deal with link time values ?<br>
<br>
</span>Make one of them weak.<br></blockquote><div><br></div><div>It'd be better to make the both zero-sized, like an array of i8 with zero elements. This idiom has come up before, and that's our recommended solution. We've tweaked the optimizers to ensure that zero-sized objects are not assumed to be distinct. </div></div></div></div>