This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: middle-end/1719: Abort in local-alloc.c
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: middle-end/1719: Abort in local-alloc.c
- From: Ian Dall <ian at beware dot dropbear dot id dot au>
- Date: Mon, 22 Jan 2001 01:20:02 +1030 (CST)
- Cc: gcc-patches at gcc dot gnu dot org
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];