This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] regmove: Fix segfault when accessing call_used_regs
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Andreas Krebbel" <krebbel at linux dot vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 13 Dec 2011 19:31:42 +0000
- Subject: Re: [PATCH] regmove: Fix segfault when accessing call_used_regs
- References: <20111213174054.GA7552@bart>
"Andreas Krebbel" <krebbel@linux.vnet.ibm.com> writes:
> Ok for mainline, 4.6, 4.5, and 4.4?
OK everywhere, but (sorry to be picky)...
> Index: gcc/regmove.c
> ===================================================================
> *** gcc/regmove.c.orig
> --- gcc/regmove.c
> *************** fixup_match_2 (rtx insn, rtx dst, rtx sr
> *** 859,865 ****
> if (REG_N_CALLS_CROSSED (REGNO (src)) == 0)
> break;
>
> ! if (call_used_regs [REGNO (dst)]
> || find_reg_fusage (p, CLOBBER, dst))
> break;
> }
> --- 859,865 ----
> if (REG_N_CALLS_CROSSED (REGNO (src)) == 0)
> break;
>
> ! if ((REGNO (dst) < FIRST_PSEUDO_REGISTER && call_used_regs [REGNO (dst)])
> || find_reg_fusage (p, CLOBBER, dst))
> break;
> }
...please use HARD_REGISTER_P (dst) instead. For one thing, it'll keep
the line within the 80 column limit.
Thanks,
Richard