OSDN Git Service

PR optimization/6086
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 30 Mar 2002 18:50:34 +0000 (18:50 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 30 Mar 2002 18:50:34 +0000 (18:50 +0000)
* combine.c (combine_simplify_rtx): If simplify_rtx failed because
of SUBREG of volatile MEM or because the MEM was mode dependent,
return CLOBBER instead of unmodified SUBREG.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51606 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/combine.c

index a320e7a..3cfed7f 100644 (file)
@@ -1,3 +1,10 @@
+2002-03-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR optimization/6086
+       * combine.c (combine_simplify_rtx): If simplify_rtx failed because
+       of SUBREG of volatile MEM or because the MEM was mode dependent,
+       return CLOBBER instead of unmodified SUBREG.
+
 Sat Mar 30 14:08:55 CET 2002  Jan Hubicka  <jh@suse.cz>
 
        * local-alloc.c (local_alloc): Avoid call of update_equiv_regs when not optimizing.
index 3e97a1a..de3bcef 100644 (file)
@@ -3875,6 +3875,13 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
          return temp;
       }
 
+      /* Don't change the mode of the MEM if that would change the meaning
+        of the address.  */
+      if (GET_CODE (SUBREG_REG (x)) == MEM
+         && (MEM_VOLATILE_P (SUBREG_REG (x))
+             || mode_dependent_address_p (XEXP (SUBREG_REG (x), 0))))
+       return gen_rtx_CLOBBER (mode, const0_rtx);
+
       /* Note that we cannot do any narrowing for non-constants since
         we might have been counting on using the fact that some bits were
         zero.  We now do this in the SET.  */