[PATCH]: Fix simple regscan bug
Daniel Berlin
dan@cgsoftware.com
Fri Jul 27 11:14:00 GMT 2001
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
More information about the Gcc-patches
mailing list