]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/59754 ([ree.c] Incorrect merge while working with vector regis...
authorJakub Jelinek <jakub@redhat.com>
Fri, 10 Jan 2014 21:27:52 +0000 (22:27 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 10 Jan 2014 21:27:52 +0000 (22:27 +0100)
PR rtl-optimization/59754
* ree.c (combine_reaching_defs): Disallow !SCALAR_INT_MODE_P
modes in the REGNO != REGNO case.

From-SVN: r206542

gcc/ChangeLog
gcc/ree.c

index 997cfa710b93be1b0ef1caf54d01e608585b1236..89f60a2ea1f7af820c841f39297209dc6c528071 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/59754
+       * ree.c (combine_reaching_defs): Disallow !SCALAR_INT_MODE_P
+       modes in the REGNO != REGNO case.
+
 2014-01-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        * config/rs6000/rs6000-builtin.def: Fix pasto for VPKSDUS.
index 1c4f3ad6fa2ad3a24eae5985cf057d2e65b7dd4d..01ccd6996266eff643984cb1e75e1f660fcb7924 100644 (file)
--- a/gcc/ree.c
+++ b/gcc/ree.c
@@ -702,6 +702,18 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
       if (state->modified[INSN_UID (cand->insn)].kind != EXT_MODIFIED_NONE)
        return false;
 
+      /* Transformation of
+        (set (reg1) (expression))
+        (set (reg2) (any_extend (reg1)))
+        into
+        (set (reg2) (any_extend (expression)))
+        (set (reg1) (reg2))
+        is only valid for scalar integral modes, as it relies on the low
+        subreg of reg1 to have the value of (expression), which is not true
+        e.g. for vector modes.  */
+      if (!SCALAR_INT_MODE_P (GET_MODE (SET_DEST (PATTERN (cand->insn)))))
+       return false;
+
       /* There's only one reaching def.  */
       rtx def_insn = state->defs_list[0];