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] fix misuse of RTL flag in expr.c


    While investigating how RTL flags are used I discovered that this code
    uses MEM_KEEP_ALIAS_SET_P for REG as well as for MEM codes.  This
    patch fixes what could become a latent bug, so it's a judgment call
    whether it goes into 3.1 or not.  

I think it should.  A variant of this patch is obviously correct and can't
break anything.

 	{
 	  if (to_rtx == orig_to_rtx)
 	    to_rtx = copy_rtx (to_rtx);
    -	  MEM_KEEP_ALIAS_SET_P (to_rtx) = 1;
    +	  if (GET_CODE (to_rtx) == MEM)
    +	    MEM_KEEP_ALIAS_SET_P (to_rtx) = 1;
     	}

I'd put the test on the outer condition (the one testing can_address_p)
because it's clearer and there's no need to copy to_rtx if we aren't going
to change it.

That patch is pre-approved.


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