fwprop.c (propagate_rtx): Also set PR_CAN_APPEAR for subregs.
authorUlrich Weigand <ulrich.weigand@linaro.org>
Tue, 10 Apr 2012 13:50:43 +0000 (13:50 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Tue, 10 Apr 2012 13:50:43 +0000 (13:50 +0000)
* fwprop.c (propagate_rtx): Also set PR_CAN_APPEAR for subregs.

Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com>
From-SVN: r186278

gcc/ChangeLog
gcc/fwprop.c

index 4b92e94866ec6f1752f8c4ddfe21e28150592db9..bd7a2c7377d909d82bbbcfdd2d218c5a009ba428 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-10  Ulrich Weigand  <ulrich.weigand@linaro.org>
+           Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * fwprop.c (propagate_rtx): Also set PR_CAN_APPEAR for subregs.
+
 2012-04-10  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/52888
index 4fab5b060725edabb848f39a77a9e51649047825..c3530372c12a6989bf3bf0ce90d72d897befd861 100644 (file)
@@ -664,7 +664,12 @@ propagate_rtx (rtx x, enum machine_mode mode, rtx old_rtx, rtx new_rtx,
     return NULL_RTX;
 
   flags = 0;
-  if (REG_P (new_rtx) || CONSTANT_P (new_rtx))
+  if (REG_P (new_rtx)
+      || CONSTANT_P (new_rtx)
+      || (GET_CODE (new_rtx) == SUBREG
+         && REG_P (SUBREG_REG (new_rtx))
+         && (GET_MODE_SIZE (mode)
+             <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (new_rtx))))))
     flags |= PR_CAN_APPEAR;
   if (!for_each_rtx (&new_rtx, varying_mem_p, NULL))
     flags |= PR_HANDLE_MEM;