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]

PATCH: reload_reg_free_for_value_p


Under some circumstances, a hard register which is clobbered by an asm
may be used as an input operand.  This is incorrect, as such hard
register clobbers should really be treated as earlyclobbers.

For the time being, this patch rejects any candidate register which is
in reload_reg_used.  Approved by Jim Wilson, checked in.

Andrew.


Thu Nov  4 15:52:35 1999  Andrew Haley  <aph@cygnus.com>

	* reload1.c (reload_reg_free_for_value_p): Don't use a register
	that is in reload_reg_used.

Index: reload1.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload1.c,v
retrieving revision 1.181
diff -p -4 -c -r1.181 reload1.c
*** reload1.c	1999/11/06 19:09:26	1.181
--- reload1.c	1999/11/09 16:49:12
*************** reload_reg_free_for_value_p (regno, opnu
*** 5306,5313 ****
--- 5306,5320 ----
    int check_earlyclobber = 0;
    int i;
    int copy = 0;
  
+   /* ??? reload_reg_used is abused to hold the registers that are not
+      available as spill registers, including hard registers that are
+      earlyclobbered in asms.  As a temporary measure, reject anything
+      in reload_reg_used.  */
+   if (TEST_HARD_REG_BIT (reload_reg_used, regno))
+     return 0;
+ 
    if (out == const0_rtx)
      {
        copy = 1;
        out = NULL_RTX;

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