ppc regrename workaround

Richard Henderson rth@cygnus.com
Sat Oct 28 14:49:00 GMT 2000


Powerpc, in its post-reload splitters, uses gen_rtx_SUBREG to
talk about the parts of a DImode quantity.  This as opposed to
generating the correct SImode register reference.

The problem being that flow never has handled subregs of
multiple hard registers completely correctly, in that it can't
determine when the complete register dies.

When regrename comes along and replaces one DImode register
with another, this results in the replacement being considered
live at the beginning of the block, which update_life_info does
not expect, so it aborts.

Personally, I think that we should abolish SUBREG after reload,
and enforce this by aborting if it is called.  However, this
patch makes things function again, at least for splitters.


r~


        * recog.c (split_all_insns): Run cleanup_subreg_operands
        after reload.

Index: recog.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/recog.c,v
retrieving revision 1.80
diff -c -p -d -r1.80 recog.c
*** recog.c	2000/10/27 20:58:57	1.80
--- recog.c	2000/10/28 21:37:33
*************** split_all_insns (upd_life)
*** 2757,2762 ****
--- 2757,2775 ----
  		      bb->end = last;
  		      break;
  		    }
+ 
+ 		  /* ??? Coddle to md files that generate subregs in post-
+ 		     reload splitters instead of computing the proper 
+ 		     hard register.  */
+ 		  if (reload_completed)
+ 		    while (1)
+ 		      {
+ 			if (INSN_P (first))
+ 			  cleanup_subreg_operands (first);
+ 			if (first == last)
+ 			  break;
+ 			first = NEXT_INSN (first);
+ 		      }
  		}
  	    }
  


More information about the Gcc-patches mailing list