This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH COMMITTED: PR 31455: Don't decompose untiable mode casts
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 01 Jun 2007 08:07:44 -0700
- Subject: PATCH COMMITTED: PR 31455: Don't decompose untiable mode casts
PR 31455 is about a poor decomposition made by lower-subreg. I
committed the appended patch to avoid it. When we see a simple cast
of a pseudo-reg from one mode to another, and the modes are not
tieable, we mark the pseudo-reg as non-decomposable. This keeps us
from making ill-advised decompositions of floating point registers
which are copied to general registers, or vice-versa.
Bootstrapped and tested on i686-pc-linux-gnu. Committed to mainline.
Ian
2007-06-01 Ian Lance Taylor <iant@google.com>
PR rtl-optimization/31455
* lower-subreg.c (find_decomposable_subregs): Don't decompose
subregs which have a cast between modes which are not tieable.
Index: lower-subreg.c
===================================================================
--- lower-subreg.c (revision 125264)
+++ lower-subreg.c (working copy)
@@ -281,6 +281,18 @@ find_decomposable_subregs (rtx *px, void
bitmap_set_bit (decomposable_context, regno);
return -1;
}
+
+ /* If this is a cast from one mode to another, where the modes
+ have the same size, and they are not tieable, then mark this
+ register as non-decomposable. If we decompose it we are
+ likely to mess up whatever the backend is trying to do. */
+ if (outer_words > 1
+ && outer_size == inner_size
+ && !MODES_TIEABLE_P (GET_MODE (x), GET_MODE (inner)))
+ {
+ bitmap_set_bit (non_decomposable_context, regno);
+ return -1;
+ }
}
else if (REG_P (x))
{