This is the mail archive of the gcc-bugs@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]

[Bug target/12898] [3.4 Regression] Tru64 UNIX bootstrap failure: ICE in gen_reg_rtx, at emit-rtl.c:819


------- Additional Comments From falk at debian dot org  2003-11-18 12:56 -------
The trouble starts in alpha_emit_set_const:

  /* If we can't make any pseudos, TARGET is an SImode hard register, we
     can't load this constant in one insn, do this in DImode.  */

This is exactly what happens, 32768 needs 2 insns to be emitted.

  if (no_new_pseudos && mode == SImode
      && GET_CODE (target) == REG && REGNO (target) < FIRST_PSEUDO_REGISTER
      && (result = alpha_emit_set_const_1 (target, mode, c, 1)) == 0)
    {
      target = gen_lowpart (DImode, target);
      mode = DImode;
    }

This creates a paradoxical subreg:

(subreg:DI (reg:SI $15 [129]) 0)

which copy_to_suggested_reg doesn't like, it insists on REG or it will
make a new temporary:

  if (target && GET_CODE (target) == REG)
    temp = target;
  else
    temp = gen_reg_rtx (mode);

So the solution is probably to change copy_to_suggested_reg to
recognize paradoxical subregs and simply copy to the hard reg inside:

diff -u -p -r1.94.2.19 explow.c
--- explow.c	27 Oct 2003 01:31:58 -0000	1.94.2.19
+++ explow.c	18 Nov 2003 12:52:41 -0000
@@ -751,7 +751,13 @@ copy_to_suggested_reg (rtx x, rtx target
 
   if (target && GET_CODE (target) == REG)
     temp = target;
-  else
+  else if (target
+	   && GET_CODE (target) == SUBREG
+	   && GET_CODE (SUBREG_REG (target)) == REG
+	   && (GET_MODE_SIZE (mode)
+	       > GET_MODE_SIZE (GET_MODE (SUBREG_REG (target)))))
+    temp = gen_rtx_REG (mode, REGNO (SUBREG_REG (target)));
+  else 
     temp = gen_reg_rtx (mode);
 
   emit_move_insn (temp, x);

But then again, probably not, I don't really understand the concept of
paradoxical subregs... :-)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12898


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