This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] regmove: Fix segfault when accessing call_used_regs


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]