]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR rtl-optimization/71976 (insn-combiner deletes a live 64-bit shift)
authorGeorg-Johann Lay <avr@gjlay.de>
Mon, 8 Aug 2016 10:13:54 +0000 (10:13 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Mon, 8 Aug 2016 10:13:54 +0000 (10:13 +0000)
Backport from 2016-07-29 trunk r238863.
PR rtl-optimization/71976
* combine.c (get_last_value): Return 0 if the argument for which
the function is called has a wider mode than the recorded value.

From-SVN: r239239

gcc/ChangeLog
gcc/combine.c

index f9a0a0a4c9c1966df2f7aead7a32cbaf57680a47..d6d59efacecb60932a3d7427fc696df124328b6b 100644 (file)
@@ -1,3 +1,11 @@
+2016-08-08  Georg-Johann Lay  <avr@gjlay.de>
+
+       Backport from 2016-07-29 trunk r238863.
+
+       PR rtl-optimization/71976
+       * combine.c (get_last_value): Return 0 if the argument for which
+       the function is called has a wider mode than the recorded value.
+
 2016-08-04  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/72805
index 16048bf3557ea260533cf8f46273a1fbb0c17421..fb3215370deb4a7ec5f92d064b7a439eb9b79b4e 100644 (file)
@@ -13041,6 +13041,12 @@ get_last_value (const_rtx x)
       && DF_INSN_LUID (rsp->last_set) >= subst_low_luid)
     return 0;
 
+  /* If fewer bits were set than what we are asked for now, we cannot use
+     the value.  */
+  if (GET_MODE_PRECISION (rsp->last_set_mode)
+      < GET_MODE_PRECISION (GET_MODE (x)))
+    return 0;
+
   /* If the value has all its registers valid, return it.  */
   if (get_last_value_validate (&value, rsp->last_set, rsp->last_set_label, 0))
     return value;