]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Assume PUTF modifies %EFLAGS in a completely arbitrary manner, and so
authorJulian Seward <jseward@acm.org>
Wed, 24 Jul 2002 09:33:52 +0000 (09:33 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 24 Jul 2002 09:33:52 +0000 (09:33 +0000)
be completely pessimistic if it is encountered during the redundant-flag-
save/restore-elimination pass.  This fixes the following mysterious
failure:

 insane instruction
           27: PUTFL     %ecx

 valgrind: vg_from_ucode.c:2600 (vgPlain_emit_code): Assertion `sane' failed.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@516

coregrind/vg_translate.c
vg_translate.c

index 0a806944ec3d1dcd8608eb451231d31f84e4dc8f..27a02754cfb967d858c12818958c6d2e5147ed94 100644 (file)
@@ -1458,6 +1458,15 @@ static void vg_improve ( UCodeBlock* cb )
          continue;
       } 
 
+      /* PUTF modifies the %EFLAGS in essentially unpredictable ways.
+         For example people try to mess with bit 21 to see if CPUID
+         works.  The setting may or may not actually take hold.  So we
+         play safe here. */
+      if (u->opcode == PUTF) {
+         future_dead_flags = FlagsEmpty;
+         continue;
+      } 
+
       /* We can annul the flags written by this insn if it writes a
          subset (or eq) of the set of flags known to be dead after
          this insn.  If not, just record the flags also written by
index 0a806944ec3d1dcd8608eb451231d31f84e4dc8f..27a02754cfb967d858c12818958c6d2e5147ed94 100644 (file)
@@ -1458,6 +1458,15 @@ static void vg_improve ( UCodeBlock* cb )
          continue;
       } 
 
+      /* PUTF modifies the %EFLAGS in essentially unpredictable ways.
+         For example people try to mess with bit 21 to see if CPUID
+         works.  The setting may or may not actually take hold.  So we
+         play safe here. */
+      if (u->opcode == PUTF) {
+         future_dead_flags = FlagsEmpty;
+         continue;
+      } 
+
       /* We can annul the flags written by this insn if it writes a
          subset (or eq) of the set of flags known to be dead after
          this insn.  If not, just record the flags also written by