Fix #4914 (I hope)
authorSimon Marlow <marlowsd@gmail.com>
Fri, 25 Mar 2011 16:12:34 +0000 (16:12 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 25 Mar 2011 16:12:34 +0000 (16:12 +0000)
commit9c5838466769fb9d5fd2cc4cc677852fd798af03
treee6bcde14acb9d533729ffa0953c65f127b377fe4
parentbf5882d264ddef5a0bdac5495a7900f009c8cbcf
Fix #4914 (I hope)

Here's a bit of erroneous code:

00000c5c <s1ad_info>:
     c5c:       8b 45 08                mov    0x8(%ebp),%eax
     c5f:       d9 46 03                flds   0x3(%esi)
     c62:       dd d9                   fstp   %st(1)
     c64:       d9 55 08                fsts   0x8(%ebp)
     c67:       89 c6                   mov    %eax,%esi
     c69:       c7 45 00 24 0c 00 00    movl   $0xc24,0x0(%ebp)
     c70:       f7 c6 03 00 00 00       test   $0x3,%esi
     c76:       75 ac                   jne    c24 <s1ac_info>

So we should be doing some ffrees before the jne.  The code that
inserts the ffrees wasn't expecting to do it for a conditional jump,
because they are usually local, but we have a late optimisation that
shortcuts jumps-to-jumps, and that can result in a non-local
conditional jump.

This at least fixes an instance of the bug that I was able to
reproduce, let's hope there aren't any more.
compiler/nativeGen/X86/Instr.hs