<br><br><div class="gmail_quote">On 7 November 2012 15:29, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span> wrote:<div> </div><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">

<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div class="im">
I could corner down the segfault to a single function in source file. But the<br>
problem is - if that function is responsible for segfault or if it is the<br>
optimization somewhere else that is driving the segfault. In the worst case<br>
it could be so. I am yet to dive deeper there.<br>
</div></blockquote>
<br>
you should try to determine which compilation stage introduces the segmentation<br>
fault (optimizers, codegen?).  It sounds like you are trying to do so already,<br>
more comments below.<div class="im"> </div></blockquote><div> </div><div>One of the many combinations that gives me some clue that Code Generation (or optimizations during CodeGen) is going wrong.</div><div> </div><div>I have compiled the problematic function with DragonEgg to emit llvm IR (say test.ll). This is now fed to llc as follows:</div>

<div> </div><div>Original Buggy Case: [Turns off FMA3, Turns on FMA4]</div><div> </div><div> llc -fp-contract=fast -O0 -mcpu=bdver2 -mattr=-fma,+fma4 test.ll -o ComputeNonbondedUtil.s<br></div><div>Correct Case: [Turns on FMA3]</div>

<div> </div><div>llc -fp-contract=fast -O0 -mcpu=bdver2 -mattr=+fma test.ll -o ComputeNonbondedUtil.s<br></div><div>Then compiled and linked as usual with clang. The first case where FMA4 is turned on reproduces the bug even though -O0 is used. Thus, it rules out any front-end specific possibilities.</div>

<div> </div><div>However it is a little surprising why the same does not show when dragonegg is fully used for end-to-end compilation.</div><div> </div><div> </div><div>-Anitha</div></div>