This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix misuse of RTL flag in expr.c
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: janis187 at us dot ibm dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Jan 02 07:16:56 EST
- Subject: 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.