[Bug c++/35585] Miscompiled inline assembly
--- Comment #4 from nicos at maunakeatech dot com 2008-03-15 01:07 --- I think I need some help here, I looked to bug 323 and I can't see how it is related to this issue. The assertion at the end of the test case compares integers, and the iFloor function is only applied to 0 in the test. My problem is that the result in sp.bbox[0] seems total garbage. I looked at the assembly code generated by gcc (-S flag), the portion corresponding to: sp.bbox[0] = std::min(sp.bbox[0], iFloor(txcum) ); is: .L201: fld %st(1) fadd%st(2), %st fsubs .LC4 #APP fistpl -44(%ebp) #NO_APP movl-44(%ebp), %edi movl-88(%ebp), %eax sarl%edi cmpl16(%ebx), %edi jge .L204 leal-28(%ebp), %eax .L204: fld %st(0) movl(%eax), %eax fadd%st(1), %st fsubs .LC4 movl%eax, 16(%ebx) The result of iFloor is stored in %edi but whatever the result of cmpl, the value in %edi isn't used (instead the value at -28(%ebp), which appears to be uninitialized, is stored into sp.bbox[0]). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35585
[Bug c++/35585] Miscompiled inline assembly
--- Comment #3 from rguenth at gcc dot gnu dot org 2008-03-14 17:30 --- This is caused by extra precision on the 387 FPU. *** This bug has been marked as a duplicate of 323 *** -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35585
[Bug c++/35585] Miscompiled inline assembly
--- Comment #2 from nicos at maunakeatech dot com 2008-03-14 16:29 --- Created an attachment (id=15318) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15318&action=view) Preprocessed testcase -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35585
[Bug c++/35585] Miscompiled inline assembly
--- Comment #1 from nicos at maunakeatech dot com 2008-03-14 16:26 --- Created an attachment (id=15317) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15317&action=view) Testcase to reproduce the bug -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35585