<div><p>Oh and the sse instructions corrupt the stack</p><p>š</p><p>00000000 <foo>:<br /> 0: 55 push %rbp<br /> 1: 89 e5 mov %esp,%ebp<br /> 3: 8d 45 e0 lea -0x20(%rbp),%eax<br /> 6: 0f 57 c0 xorps %xmm0,%xmm0<br /> 9: 67 0f 29 00 movaps %xmm0,(%eax)<br /> d: 67 c7 40 10 00 00 00 movl $0x0,0x10(%eax)<br /> 14: 00 <br /> 15: 5d pop %rbp<br /> 16: c3 retq</p></div><div>š</div><div>22.01.2016, 19:32, "Peter Stone via cfe-dev" <cfe-dev@lists.llvm.org>:</div><blockquote type="cite"><div>Hi</div><div>š</div><div>I have a problem with clang and the -mx32 flag. I noticed this problem with corruption on the stack and I narrowed it down to initialising an array thus:</div><div>š</div><div><p>% cat > 0.c<br />void foo() {<br /> unsigned char bar[20] = { 0 };<br />}</p><p><br />%clang -m32 -c 0.c <br />% nm 0.o <br /><span>00000000</span>šT foo<br /> U memset</p><p>###########################################################<br />% clang -mx32 -c 0.c<br />% nm 0.o <br /><span>00000000</span> T foo</p><p>-> Missing call to memset</p><p>###############################################################</p><p><br />% clang -m64 -c 0.c <br />% nm 0.o <br /><span>0000000000000000</span> T foo<br /> U memset</p><p>š</p><p>The same thing happens with clangš3.7.1 and 3.9</p><p>š</p><p>Cheers</p><p>š</p><p><br />Stoned Pete</p><p>š</p></div>,<p>_______________________________________________<br />cfe-dev mailing list<br /><a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br /><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a></p></blockquote>