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: Fix PR/13938 and PR/13893 (Was: Share clobbers of hard registers...)


> 2004-02-05  Josef Zlomek  <zlomekj@suse.cz>
> 
> 	* emit-rtl.c (verify_rtx_sharing): Share only flag registers
> 	in clobber.
> 	(copy_rtx_if_shared_1): Likewise.
> 	(copy_insn_1): Likewise.
> 	(gen_hard_reg_clobber): Likewise.
> 	* rtl.c (copy_rtx): Likewise.

Honza submitted a patch which fixes the PRs by fixing a bug in
reg-stack.c (http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00403.html)

Josef

> Index: emit-rtl.c
> ===================================================================
> RCS file: /cvs/gcc-cvs/gcc/gcc/emit-rtl.c,v
> retrieving revision 1.375
> diff -c -p -c -3 -p -r1.375 emit-rtl.c
> *** emit-rtl.c	4 Feb 2004 06:12:50 -0000	1.375
> --- emit-rtl.c	5 Feb 2004 10:29:54 -0000
> *************** verify_rtx_sharing (rtx orig, rtx insn)
> *** 2154,2160 ****
>         return;
>         /* SCRATCH must be shared because they represent distinct values.  */
>       case CLOBBER:
> !       if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER)
>   	return;
>         break;
>   
> --- 2154,2161 ----
>         return;
>         /* SCRATCH must be shared because they represent distinct values.  */
>       case CLOBBER:
> !       if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
> ! 	  && GET_MODE_CLASS (GET_MODE (XEXP (x, 0))) == MODE_CC)
>   	return;
>         break;
>   
> *************** repeat:
> *** 2452,2458 ****
>         /* SCRATCH must be shared because they represent distinct values.  */
>         return;
>       case CLOBBER:
> !       if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER)
>   	return;
>         break;
>   
> --- 2453,2460 ----
>         /* SCRATCH must be shared because they represent distinct values.  */
>         return;
>       case CLOBBER:
> !       if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
> ! 	  && GET_MODE_CLASS (GET_MODE (XEXP (x, 0))) == MODE_CC)
>   	return;
>         break;
>   
> *************** copy_insn_1 (rtx orig)
> *** 4949,4955 ****
>       case ADDRESSOF:
>         return orig;
>       case CLOBBER:
> !       if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER)
>   	return orig;
>         break;
>   
> --- 4951,4959 ----
>       case ADDRESSOF:
>         return orig;
>       case CLOBBER:
> !       if (REG_P (XEXP (orig, 0))
> ! 	  && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER
> ! 	  && GET_MODE_CLASS (GET_MODE (XEXP (orig, 0))) == MODE_CC)
>   	return orig;
>         break;
>   
> *************** static GTY((deletable(""))) rtx hard_reg
> *** 5472,5478 ****
>   rtx
>   gen_hard_reg_clobber (enum machine_mode mode, unsigned int regno)
>   {
> !   if (hard_reg_clobbers[mode][regno])
>       return hard_reg_clobbers[mode][regno];
>     else
>       return (hard_reg_clobbers[mode][regno] =
> --- 5476,5482 ----
>   rtx
>   gen_hard_reg_clobber (enum machine_mode mode, unsigned int regno)
>   {
> !   if (GET_MODE_CLASS (mode) == MODE_CC && hard_reg_clobbers[mode][regno])
>       return hard_reg_clobbers[mode][regno];
>     else
>       return (hard_reg_clobbers[mode][regno] =
> Index: rtl.c
> ===================================================================
> RCS file: /cvs/gcc-cvs/gcc/gcc/rtl.c,v
> retrieving revision 1.132
> diff -c -p -c -3 -p -r1.132 rtl.c
> *** rtl.c	21 Jan 2004 20:40:04 -0000	1.132
> --- rtl.c	5 Feb 2004 10:30:48 -0000
> *************** copy_rtx (rtx orig)
> *** 225,231 ****
>       case ADDRESSOF:
>         return orig;
>       case CLOBBER:
> !       if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER)
>   	return orig;
>         break;
>   
> --- 225,233 ----
>       case ADDRESSOF:
>         return orig;
>       case CLOBBER:
> !       if (REG_P (XEXP (orig, 0))
> ! 	  && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER
> ! 	  && GET_MODE_CLASS (GET_MODE (XEXP (orig, 0))) == MODE_CC)
>   	return orig;
>         break;
>   

-- 
      Josef Zlomek
      zlomek@users.sf.net
      josef.zlomek@email.cz
      zlomj9am@artax.karlin.mff.cuni.cz
      http://zlomek.matfyz.cz/
      http://artax.karlin.mff.cuni.cz/~zlomj9am/
      ICQ: 152422432
      GPG fingerprint: 74E6 31D3 56D7 91FD 5A06  6BD5 96FF 99C4 25C0 EC0B


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