This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Fix simple regscan bug
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH]: Fix simple regscan bug
- From: Daniel Berlin <dan at cgsoftware dot com>
- Date: Fri, 27 Jul 2001 14:14:04 -0400
Noticed on the new-regalloc branch, but bug exists in mainline too.
According to the comment above REG_N_REFS, a set counts as a ref.
Yet we incremented REG_N_SETS without incrementing REG_N_REFS, which
is wrong.
2001-07-27 Daniel Berlin <dan@cgsoftware.com>
* regclass.c (reg_scan_mark_refs): Increment REG_N_REFS when we
increment REG_N_SETS.
Index: regclass.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/regclass.c,v
retrieving revision 1.124
diff -c -3 -p -w -B -b -r1.124 regclass.c
*** regclass.c 2001/07/20 16:55:03 1.124
--- regclass.c 2001/07/27 18:12:24
*************** reg_scan_mark_refs (x, insn, note_flag,
*** 2427,2433 ****
--- 2427,2436 ----
if (GET_CODE (dest) == REG
&& REGNO (dest) >= min_regno)
+ {
REG_N_SETS (REGNO (dest))++;
+ REG_N_REFS (REGNO (dest))++;
+ }
/* If this is setting a pseudo from another pseudo or the sum of a
pseudo and a constant integer and the other pseudo is known to be
--
"For my birthday I got a humidifier and a de-humidifier... I put
them in the same room and let them fight it out. Then I filled
my humidifier with wax, and now my room is all shiny.
"-Steven Wright