This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH COMMITTED: Another lower-subreg.c patch


Roger Sayle discovered a case which the lower subreg pass did not
handle on mips-sgi-irix6.5:

typedef float TFtype __attribute__ ((mode (TF)));
TFtype foo()
{
  TFtype y = 0;
  return y;
}

The bug was in handling a clobber of a TImode register, cast to
TFmode, being split to DImode.  This patch fixes the problem.
Bootstrapped on i686-pc-linux-gnu.  Committed.

Ian


2007-02-01  Ian Lance Taylor  <iant@google.com>

	* lower-subreg.c (resolve_clobber): Handle a subreg of a concatn.


Index: lower-subreg.c
===================================================================
--- lower-subreg.c	(revision 121492)
+++ lower-subreg.c	(working copy)
@@ -807,19 +807,20 @@ resolve_clobber (rtx pat, rtx insn)
   unsigned int words, i;
 
   reg = XEXP (pat, 0);
-  if (!resolve_reg_p (reg))
+  if (!resolve_reg_p (reg) && !resolve_subreg_p (reg))
     return false;
 
   orig_mode = GET_MODE (reg);
   words = GET_MODE_SIZE (orig_mode);
   words = (words + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
 
-  XEXP (pat, 0) = simplify_subreg_concatn (word_mode, reg, 0);
+  XEXP (pat, 0) = simplify_gen_subreg_concatn (word_mode, reg, orig_mode, 0);
   for (i = words - 1; i > 0; --i)
     {
       rtx x;
 
-      x = simplify_subreg_concatn (word_mode, reg, i * UNITS_PER_WORD);
+      x = simplify_gen_subreg_concatn (word_mode, reg, orig_mode,
+				       i * UNITS_PER_WORD);
       x = gen_rtx_CLOBBER (VOIDmode, x);
       emit_insn_after (x, insn);
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]