]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 398066 s390x: cgijl dep1, 0 reports false uninitialised values warning.
authorMark Wielaard <mark@klomp.org>
Mon, 3 Sep 2018 10:56:53 +0000 (12:56 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 3 Sep 2018 11:02:22 +0000 (13:02 +0200)
This is similar to bug #387712 (about cgijnl), but a newer gcc uses cgijl
now. So use a similar fix when cc_dep2 is zero, only check whether the
most significant bit of cc_dep1 is set to 1.

NEWS
VEX/priv/guest_s390_helpers.c

diff --git a/NEWS b/NEWS
index c79d775092dc7cd77a92420ff89e0f83f33c69f6..9a6e2a3676d685cea198c43f5847bcdb5b437adb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -145,6 +145,7 @@ where XXXXXX is the bug number as listed below.
 397012  glibc ld.so uses arch_prctl on i386
 397354  utimensat should ignore timespec tv_sec if tv_nsec is UTIME_NOW/OMIT
 397424  glibc 2.27 and gdb_server tests
+398066  s390x: cgijl dep1, 0 reports false unitialised values warning
 
 n-i-bz  Fix missing workq_ops operations (macOS)
 n-i-bz  fix bug in strspn replacement
index 52e4ce936800e158165f6f2f9d7fde3466a324bf..aeda6770449f4403e371277f6fd2d2372ada8a2b 100644 (file)
@@ -1935,6 +1935,14 @@ guest_s390x_spechelper(const HChar *function_name, IRExpr **args,
             return unop(Iop_1Uto32, binop(Iop_CmpNE64, cc_dep1, cc_dep2));
          }
          if (cond == 4 || cond == 4 + 1) {
+            if (isC64_exactly(cc_dep2, 0)) {
+               /*     dep1 <signed 0
+                  --> m.s.bit of dep1 == 1 */
+               return unop(Iop_64to32,
+                           binop(Iop_And64,
+                                 binop(Iop_Shr64, cc_dep1, mkU8(63)),
+                                 mkU64(1)));
+            }
             return unop(Iop_1Uto32, binop(Iop_CmpLT64S, cc_dep1, cc_dep2));
          }
          if (cond == 8 + 4 || cond == 8 + 4 + 1) {