Detect FPU instructions which set %EFLAGS and mark the resulting
UInstrs accordingly.  Fixes a bug in the simulated CPU in which the
results of f{u}comi{p} FPU insns were ignored, potentially leading to
wrong program behaviour.  This will only have happened to people using
P6/P7/K7 class CPUs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@30 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/vg_from_ucode.c b/vg_from_ucode.c
index 4d04293..5e32084 100644
--- a/vg_from_ucode.c
+++ b/vg_from_ucode.c
@@ -2598,8 +2598,13 @@
       case FPU:
          vg_assert(u->tag1 == Lit16);
          vg_assert(u->tag2 == NoValue);
+         vg_assert(u->flags_r == FlagsEmpty);
+         if (u->flags_w != FlagsEmpty) 
+            emit_get_eflags();
          synth_fpu_no_mem ( (u->val1 >> 8) & 0xFF,
                             u->val1 & 0xFF );
+         if (u->flags_w != FlagsEmpty) 
+            emit_put_eflags();
          break;
 
       default: