Mark Wielaard 3e802c
commit d1d90974d5239151892742b11dd26cf12055aade
Mark Wielaard 3e802c
Author: cborntra <cborntra@8f6e269a-dfd6-0310-a8e1-e2731360e62c>
Mark Wielaard 3e802c
Date:   Thu Feb 5 11:05:10 2015 +0000
Mark Wielaard 3e802c
Mark Wielaard 3e802c
    Fix bug 343802. We need to handle one more special case in the spechelper
Mark Wielaard 3e802c
    
Mark Wielaard 3e802c
    
Mark Wielaard 3e802c
    git-svn-id: svn://svn.valgrind.org/vex/trunk@3083 8f6e269a-dfd6-0310-a8e1-e2731360e62c
Mark Wielaard 3e802c
Mark Wielaard 3e802c
diff --git a/VEX/priv/guest_s390_helpers.c b/VEX/priv/guest_s390_helpers.c
Mark Wielaard 3e802c
index 78ca2ef..df1f24b 100644
Mark Wielaard 3e802c
--- a/VEX/priv/guest_s390_helpers.c
Mark Wielaard 3e802c
+++ b/VEX/priv/guest_s390_helpers.c
Mark Wielaard 3e802c
@@ -1958,7 +1958,10 @@ guest_s390x_spechelper(const HChar *function_name, IRExpr **args,
Mark Wielaard 3e802c
             return unop(Iop_1Uto32, binop(Iop_CmpNE64, cc_dep1, mkU64(0)));
Mark Wielaard 3e802c
          }
Mark Wielaard 3e802c
          if (cond == 4 || cond == 4 + 1) {
Mark Wielaard 3e802c
-            return unop(Iop_1Uto32, binop(Iop_CmpLT64S, cc_dep1, mkU64(0)));
Mark Wielaard 3e802c
+             /* Special case cc_dep < 0. Only check the MSB to avoid bogus
Mark Wielaard 3e802c
+               memcheck complaints due to gcc magic. Fixes 343802
Mark Wielaard 3e802c
+             */
Mark Wielaard 3e802c
+            return unop(Iop_64to32, binop(Iop_Shr64, cc_dep1, mkU8(63)));
Mark Wielaard 3e802c
          }
Mark Wielaard 3e802c
          if (cond == 8 + 4 || cond == 8 + 4 + 1) {
Mark Wielaard 3e802c
             return unop(Iop_1Uto32, binop(Iop_CmpLE64S, cc_dep1, mkU64(0)));