|
From: Julian S. <js...@ac...> - 2006-11-19 01:20:05
|
> I have reduced the program to the attached assembly. It was a bit > hard because the original code was in qt4, which is very large... Thanks. I managed to reduce it further to the program below, but unfortunately I cannot think of a simple way to fix it. The problem is that 'andl $-2, 8(%esp)' sets %eflags to undefined. Then 'fucompp; fnstsw %ax; sahf' makes all %eflags except the O (overflow) flag defined. Neither the following 'jp' nor 'je' depend on O, and V's dataflow analysis can see that for the 'jp'. However, the 'je' is in a different basic block and the dataflow analysis does not work well across blocks. Hence it believes 'je' depends on the O flag, which is undefined, when in fact it does not. What optimisation level was this code compiled at? J .file "test.c" .text .globl main .type main, @function main: subl $24, %esp andl $-2, 8(%esp) fldz fldz fucompp fnstsw %ax sahf jp .L5 je .L5 .L5: movl $0, %eax addl $24, %esp ret .size main, .-main .ident "GCC: (GNU) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)" .section .note.GNU-stack,"",@progbits |