Message ID | alpine.LNX.2.02.1107251601530.1374@localhost.localdomain |
---|---|
State | New |
Headers | show |
Hi, On Mon, 25 Jul 2011, Dimitrios Apostolou wrote: > Bug found, in df_mark_reg I need to iterate until regno + n, not n. The error > is at the following hunk: > > --- gcc/df-scan.c 2011-02-02 20:08:06 +0000 > +++ gcc/df-scan.c 2011-07-24 17:16:46 +0000 > @@ -3713,35 +3717,40 @@ df_mark_reg (rtx reg, void *vset) > if (regno < FIRST_PSEUDO_REGISTER) > { > int n = hard_regno_nregs[regno][GET_MODE (reg)]; > - bitmap_set_range (set, regno, n); > + int i; > + for (i=regno; i<n; i++) > + SET_HARD_REG_BIT (*set, i); > } No. n is a count, hence the upper bound is regno + n. Ciao, Michael.
On 07/25/11 16:20, Michael Matz wrote: > Hi, > > On Mon, 25 Jul 2011, Dimitrios Apostolou wrote: > >> Bug found, in df_mark_reg I need to iterate until regno + n, not n. The error >> is at the following hunk: >> >> --- gcc/df-scan.c 2011-02-02 20:08:06 +0000 >> +++ gcc/df-scan.c 2011-07-24 17:16:46 +0000 >> @@ -3713,35 +3717,40 @@ df_mark_reg (rtx reg, void *vset) >> if (regno < FIRST_PSEUDO_REGISTER) >> { >> int n = hard_regno_nregs[regno][GET_MODE (reg)]; >> - bitmap_set_range (set, regno, n); >> + int i; >> + for (i=regno; i<n; i++) >> + SET_HARD_REG_BIT (*set, i); >> } > > No. n is a count, hence the upper bound is regno + n. Also, see add_to_hard_reg_set. Bernd
On Mon, Jul 25, 2011 at 4:20 PM, Michael Matz <matz@suse.de> wrote: > Hi, > > On Mon, 25 Jul 2011, Dimitrios Apostolou wrote: > >> Bug found, in df_mark_reg I need to iterate until regno + n, not n. The error >> is at the following hunk: >> >> --- gcc/df-scan.c 2011-02-02 20:08:06 +0000 >> +++ gcc/df-scan.c 2011-07-24 17:16:46 +0000 >> @@ -3713,35 +3717,40 @@ df_mark_reg (rtx reg, void *vset) >> if (regno < FIRST_PSEUDO_REGISTER) >> { >> int n = hard_regno_nregs[regno][GET_MODE (reg)]; >> - bitmap_set_range (set, regno, n); >> + int i; >> + for (i=regno; i<n; i++) >> + SET_HARD_REG_BIT (*set, i); >> } > > No. n is a count, hence the upper bound is regno + n. Indeed. Which is what Jimis said. Note the "error is in this hunk" ;-) Ciao! Steven
That was a bug, indeed, but unfortunately it wasn't the one causing the crash I posted earlier... Even after fixing it I get the same backtrace from gdb. So the petition "spot the bug" holds... Thanks, Dimitris
--- gcc/df-scan.c 2011-02-02 20:08:06 +0000 +++ gcc/df-scan.c 2011-07-24 17:16:46 +0000 @@ -3713,35 +3717,40 @@ df_mark_reg (rtx reg, void *vset) if (regno < FIRST_PSEUDO_REGISTER) { int n = hard_regno_nregs[regno][GET_MODE (reg)]; - bitmap_set_range (set, regno, n); + int i; + for (i=regno; i<n; i++) + SET_HARD_REG_BIT (*set, i); } else Many thanks to monoid from IRC for spotting it! I'll post an updated patch soon. Thanks, Dimitris