<div dir="ltr"><br><br><div class="gmail_quote">2008/9/5 Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
> Any ideas?<br>
<br>
Most likely it is the gcc folder doing it.<br>
This gcc optimization is run in llvm-gcc<br>
because it's basically impossible to turn<br>
it off!  </blockquote><div>Agree. I found that gcc option -fstrict-overflow, with which gcc will do that simplication.</div><div>Defaultly, that option is turn on with -O2 or above.</div><div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
You can check by passing<br>
-mllvm -disable-llvm-optzns<br>
to llvm-gcc along with -O2.  If the<br>
optimization still occurs then it was<br>
gcc that did it.</blockquote><div>eh... I got some error as following:</div><div></div><div>llvm-gcc -O2 -mllvm -disable-llvm-optzns -emit-llvm -c test.c -o test.ll -S</div><div></div><div>cc1: warning: unrecognized gcc debugging option: i<br>
cc1: warning: unrecognized gcc debugging option: s<br>cc1: warning: unrecognized gcc debugging option: b<br>cc1: warning: unrecognized gcc debugging option: l<br>cc1: warning: unrecognized gcc debugging option: e<br>cc1: warning: unrecognized gcc debugging option: -<br>
cc1: warning: unrecognized gcc debugging option: l<br>cc1: warning: unrecognized gcc debugging option: l<br>cc1: warning: unrecognized gcc debugging option: m<br>cc1: warning: unrecognized gcc debugging option: -<br>cc1: warning: unrecognized gcc debugging option: o<br>
cc1: warning: unrecognized gcc debugging option: t<br>cc1: warning: unrecognized gcc debugging option: z<br>cc1: warning: unrecognized gcc debugging option: n<br>cc1: warning: unrecognized gcc debugging option: s<br>cc1: Unknown command line argument '-mtune=generic'.  Try: 'cc1 --help'<br>
<br></div><div>Am I missing something?</div><div></div><div></div><div>Sheng.</div><div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<br>
Ciao,<br>
<font color="#888888"><br>
Duncan.<br>
</font></blockquote></div><br></div>