Message ID | CAAdirjzj2+Zg2frrZJG8gd4O4urZRWFy9kqJ90CPA8inpq0hbQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | [regrename] Fix PR87330 : ICE in scan_rtx_reg, at regrename.c | expand |
> Other notes need not be changed, as they don't hold renamed register > information. > > Ok for trunk? No, REG_DEAD & REG_UNUSED note must be recomputed by passes consuming them. > 2018-10-09 Sameera Deshpande <sameera.deshpande@linaro.org > > * gcc/regrename.c (regrename_do_replace): Add condition to alter > regname if note has same register marked dead in notes. No gcc/ prefix in gcc/ChangeLog. -- Eric Botcazou
On Tue, 9 Oct 2018 at 04:08, Eric Botcazou <ebotcazou@adacore.com> wrote: > > > Other notes need not be changed, as they don't hold renamed register > > information. > > > > Ok for trunk? > > No, REG_DEAD & REG_UNUSED note must be recomputed by passes consuming them. > > > 2018-10-09 Sameera Deshpande <sameera.deshpande@linaro.org > > > > * gcc/regrename.c (regrename_do_replace): Add condition to alter > > regname if note has same register marked dead in notes. > > No gcc/ prefix in gcc/ChangeLog. > > -- > Eric Botcazou Hi Eric, Thanks for your comments. Please find attached updated patch invoking data flow for updating the REG_DEAD and REG_UNUSED notes. As this change is made in falkor specific file, adding James and Richard for review. Ok for trunk? Changelog: 2018-10-30 Sameera Deshpande <sameera.deshpande@linaro.org * gcc/config/aarch64/falkor-tag-collision-avoidance.c (execute_tag_collision_avoidance): Invoke df_note_add_problem to recompute REG_DEAD and REG_UNUSED notes before analysis. -- - Thanks and regards, Sameera D. diff --git a/gcc/config/aarch64/falkor-tag-collision-avoidance.c b/gcc/config/aarch64/falkor-tag-collision-avoidance.c index fb6568f..4ca9d66 100644 --- a/gcc/config/aarch64/falkor-tag-collision-avoidance.c +++ b/gcc/config/aarch64/falkor-tag-collision-avoidance.c @@ -805,6 +805,7 @@ execute_tag_collision_avoidance () df_set_flags (DF_RD_PRUNE_DEAD_DEFS); df_chain_add_problem (DF_UD_CHAIN); df_compute_regs_ever_live (true); + df_note_add_problem (); df_analyze (); df_set_flags (DF_DEFER_INSN_RESCAN);
On 30/10/2018 10:09, Sameera Deshpande wrote: > On Tue, 9 Oct 2018 at 04:08, Eric Botcazou <ebotcazou@adacore.com> wrote: >> >>> Other notes need not be changed, as they don't hold renamed register >>> information. >>> >>> Ok for trunk? >> >> No, REG_DEAD & REG_UNUSED note must be recomputed by passes consuming them. >> >>> 2018-10-09 Sameera Deshpande <sameera.deshpande@linaro.org >>> >>> * gcc/regrename.c (regrename_do_replace): Add condition to alter >>> regname if note has same register marked dead in notes. >> >> No gcc/ prefix in gcc/ChangeLog. >> >> -- >> Eric Botcazou > > Hi Eric, > > Thanks for your comments. > > Please find attached updated patch invoking data flow for updating the > REG_DEAD and REG_UNUSED notes. > > As this change is made in falkor specific file, adding James and > Richard for review. > > Ok for trunk? > > Changelog: > > 2018-10-30 Sameera Deshpande <sameera.deshpande@linaro.org > > * gcc/config/aarch64/falkor-tag-collision-avoidance.c > (execute_tag_collision_avoidance): Invoke df_note_add_problem to > recompute REG_DEAD and REG_UNUSED notes before analysis. > 'Call df_note_add_problem.' is enough. OK with that change. R. > > bug87330.patch > > diff --git a/gcc/config/aarch64/falkor-tag-collision-avoidance.c b/gcc/config/aarch64/falkor-tag-collision-avoidance.c > index fb6568f..4ca9d66 100644 > --- a/gcc/config/aarch64/falkor-tag-collision-avoidance.c > +++ b/gcc/config/aarch64/falkor-tag-collision-avoidance.c > @@ -805,6 +805,7 @@ execute_tag_collision_avoidance () > df_set_flags (DF_RD_PRUNE_DEAD_DEFS); > df_chain_add_problem (DF_UD_CHAIN); > df_compute_regs_ever_live (true); > + df_note_add_problem (); > df_analyze (); > df_set_flags (DF_DEFER_INSN_RESCAN); > >
On Tue, 30 Oct 2018 at 16:16, Richard Earnshaw (lists) <Richard.Earnshaw@arm.com> wrote: > > On 30/10/2018 10:09, Sameera Deshpande wrote: > > On Tue, 9 Oct 2018 at 04:08, Eric Botcazou <ebotcazou@adacore.com> wrote: > >> > >>> Other notes need not be changed, as they don't hold renamed register > >>> information. > >>> > >>> Ok for trunk? > >> > >> No, REG_DEAD & REG_UNUSED note must be recomputed by passes consuming them. > >> > >>> 2018-10-09 Sameera Deshpande <sameera.deshpande@linaro.org > >>> > >>> * gcc/regrename.c (regrename_do_replace): Add condition to alter > >>> regname if note has same register marked dead in notes. > >> > >> No gcc/ prefix in gcc/ChangeLog. > >> > >> -- > >> Eric Botcazou > > > > Hi Eric, > > > > Thanks for your comments. > > > > Please find attached updated patch invoking data flow for updating the > > REG_DEAD and REG_UNUSED notes. > > > > As this change is made in falkor specific file, adding James and > > Richard for review. > > > > Ok for trunk? > > > > Changelog: > > > > 2018-10-30 Sameera Deshpande <sameera.deshpande@linaro.org > > > > * gcc/config/aarch64/falkor-tag-collision-avoidance.c > > (execute_tag_collision_avoidance): Invoke df_note_add_problem to > > recompute REG_DEAD and REG_UNUSED notes before analysis. > > > > 'Call df_note_add_problem.' is enough. > > OK with that change. > > R. > > > > > bug87330.patch > > > > diff --git a/gcc/config/aarch64/falkor-tag-collision-avoidance.c b/gcc/config/aarch64/falkor-tag-collision-avoidance.c > > index fb6568f..4ca9d66 100644 > > --- a/gcc/config/aarch64/falkor-tag-collision-avoidance.c > > +++ b/gcc/config/aarch64/falkor-tag-collision-avoidance.c > > @@ -805,6 +805,7 @@ execute_tag_collision_avoidance () > > df_set_flags (DF_RD_PRUNE_DEAD_DEFS); > > df_chain_add_problem (DF_UD_CHAIN); > > df_compute_regs_ever_live (true); > > + df_note_add_problem (); > > df_analyze (); > > df_set_flags (DF_DEFER_INSN_RESCAN); > > > > > Thanks Richard! Patch committed at revision 265618. -- - Thanks and regards, Sameera D.
diff --git a/gcc/regrename.c b/gcc/regrename.c index 8424093..a3446a2 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -970,6 +970,7 @@ regrename_do_replace (struct du_head *head, int reg) unsigned int regno = ORIGINAL_REGNO (*chain->loc); struct reg_attrs *attr = REG_ATTRS (*chain->loc); int reg_ptr = REG_POINTER (*chain->loc); + rtx note; if (DEBUG_INSN_P (chain->insn) && REGNO (*chain->loc) != base_regno) validate_change (chain->insn, &(INSN_VAR_LOCATION_LOC (chain->insn)), @@ -986,6 +987,11 @@ regrename_do_replace (struct du_head *head, int reg) last_reg = *chain->loc; } validate_change (chain->insn, chain->loc, last_repl, true); + note = find_regno_note (chain->insn, REG_DEAD, base_regno); + if (note != 0) + { + validate_change (chain->insn, &XEXP (note, 0), last_repl, true); + } } }