]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/28011 ([SH] g++ generates wrong code, if '-fno-exceptions...
authorKaz Kojima <kkojima@gcc.gnu.org>
Wed, 20 Jun 2007 05:52:05 +0000 (05:52 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Wed, 20 Jun 2007 05:52:05 +0000 (05:52 +0000)
PR rtl-optimization/28011
Backport from mainline.
* reload.c (push_reload): Set dont_share if IN appears in OUT
also when IN is a PLUS rtx.
(reg_overlap_mentioned_for_reload_p): Return true if X and IN
are same PLUS rtx.

From-SVN: r125872

gcc/ChangeLog
gcc/reload.c

index bcb24e146c55965f7c98e821b3fe6962cc6ce6bd..3ce3bc9b75662313bac504dd33a8bcfb9e94ace7 100644 (file)
@@ -1,3 +1,12 @@
+2007-06-20  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR rtl-optimization/28011
+       Backport from mainline.
+       * reload.c (push_reload): Set dont_share if IN appears in OUT
+       also when IN is a PLUS rtx.
+       (reg_overlap_mentioned_for_reload_p): Return true if X and IN
+       are same PLUS rtx.
+
 2007-06-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/32353
index d775259d6c1ff668efe3bcc16fb60b964fb2499b..eea9cc738a183155e2507ea764016f80f3bc811f 100644 (file)
@@ -1210,7 +1210,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
 
   /* If IN appears in OUT, we can't share any input-only reload for IN.  */
   if (in != 0 && out != 0 && MEM_P (out)
-      && (REG_P (in) || MEM_P (in))
+      && (REG_P (in) || MEM_P (in) || GET_CODE (in) == PLUS)
       && reg_overlap_mentioned_for_reload_p (in, XEXP (out, 0)))
     dont_share = 1;
 
@@ -6464,7 +6464,8 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
       if (REG_P (in))
        return 0;
       else if (GET_CODE (in) == PLUS)
-       return (reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0))
+       return (rtx_equal_p (x, in)
+               || reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0))
                || reg_overlap_mentioned_for_reload_p (x, XEXP (in, 1)));
       else return (reg_overlap_mentioned_for_reload_p (XEXP (x, 0), in)
                   || reg_overlap_mentioned_for_reload_p (XEXP (x, 1), in));