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]

Re: middle-end/1719: Abort in local-alloc.c


I believe I now have a fix for the above bug report I just filed.
The problem appears to be that regclass.c (scan_one_insn)
makes modifications after the register usage is calculated.
This function correctly increments REF_N_SETS, but it should also
increment REF_N_REFS.

Here is a ChangeLog entry:

Mon Jan 22 00:55:08 2001  Ian Dall  <ian@gateway.beware.dropbear.id.au>

	* regclass.c (scan_one_insn): Increment register reference count
 	when insering new insn.

And a patch:

*** /usr/src/gnu/gcc/gcc/regclass.c	Sat Jan 13 05:22:19 2001
--- regclass.c	Mon Jan 22 00:54:47 2001
***************
*** 1008,1013 ****
--- 1008,1017 ----
        REG_N_SETS (REGNO (recog_data.operand[0]))++;
  
        *recog_data.operand_loc[1] = recog_data.operand[0];
+ 
+       /* ... and one more reference to register.  */
+       REG_N_REFS (REGNO (recog_data.operand[0]))++;
+ 
        for (i = recog_data.n_dups - 1; i >= 0; i--)
  	if (recog_data.dup_num[i] == 1)
  	  *recog_data.dup_loc[i] = recog_data.operand[0];

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