<HTML><HEAD><TITLE>Samsung Enterprise Portal mySingle</TITLE>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<STYLE id=mysingle_style type=text/css>P {
        MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt
}
TD {
        MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt
}
LI {
        MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt
}
BODY {
        LINE-HEIGHT: 1.4; MARGIN: 10px; FONT-FAMILY: Arial, arial; FONT-SIZE: 9pt
}
</STYLE>

<META name=GENERATOR content=ActiveSquare></HEAD>
<BODY>
<P>Hello all,</P>
<P>    I saw some odd behaviour in clang for the following test case. g++ and intel compiler produce binary which dumps "Floating point exception (core dumped)" on execution. Incase of clang random values are returned for each execution. Originally I had written a basic template specialization code which does a divide by zero and saw this bug. However clang warns of divide by zero similar to g++ and icc.</P>
<P> </P>
<P>clang version is some trunk  head revision on 12 sep 2013.</P>
<P> </P>
<P>#include <iostream></P>
<P>void F002() {<BR>  int b = 23/0;<BR>  std::cout << "\n b == " <<<BR>    b << std::endl;<BR>}</P>
<P>int main() {<BR>  F002();<BR>}</P>
<P> </P>
<P>======= Following code also executes fine in clang without floating point exception. g++ & intel compiler binary emits floating point exception  ======</P>
<P>template <int d, int e><BR>int F004() {<BR>  return d/e;<BR>}</P>
<P>int main() {<BR>  F004<4,5>();<BR>  F004<4,0>();<BR>}<BR></P>
<P>============ clang version info ============</P>
<P>test$ clang++ -v sf2.cpp <BR>clang version 3.4 <BR>Target: x86_64-unknown-linux-gnu<BR>Thread model: posix<BR>Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7<BR>Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.2<BR>Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7<BR> "/usr/local/bin/clang-3.4" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name sf2.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -v -resource-dir /usr/local/bin/../lib/clang/3.4 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/x86_64-linux-gnu -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/c++/4.7 -internal-isystem /usr/local/include -internal-isystem /usr/local/bin/../lib/clang/3.4/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /opt/SISO_BDP_SENTHIL_LLVM_JUL25/test -ferror-limit 19 -fmessage-length 135 -mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-slp -o /tmp/sf2-0ecc11.o -x c++ sf2.cpp<BR>clang -cc1 version 3.4 based upon LLVM 3.4svn default target x86_64-unknown-linux-gnu<BR></P></BODY></HTML><img src='http://ext.samsung.net/mailcheck/SeenTimeChecker?do=6896e2df0a823737fd14a177cdc17e4a1c1fc8b52c2652bf9cdd14f0554fc2de1d78c8484d0968ef1d70666c366810d91b20909a04efd4d2748cfe1d4e847419cf878f9a26ce15a0' border=0 width=0 height=0 style='display:none'>