This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] possible fix for 14700
- From: Eric Christopher <echristo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 02 Apr 2004 09:55:10 -0800
- Subject: [patch] possible fix for 14700
This patch works for PR 14700 by not allowing combine to delete reg_dead
sets if the stores are to global register variables. It appears to be
the right way to do it, but I'm not positive.
Comments? OK?
-eric
--
Eric Christopher <echristo@redhat.com>
2004-04-02 Eric Christopher <echristo@redhat.com>
PR/14700
* combine.c (distribute_notes): Don't delete stores
to global register variables.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.422
diff -u -p -w -r1.422 combine.c
--- combine.c 16 Mar 2004 16:14:50 -0000 1.422
+++ combine.c 2 Apr 2004 08:24:07 -0000
@@ -12649,8 +12649,10 @@ distribute_notes (rtx notes, rtx from_in
/* If the register is being set at TEM, see if that is all
TEM is doing. If so, delete TEM. Otherwise, make this
- into a REG_UNUSED note instead. */
- if (reg_set_p (XEXP (note, 0), PATTERN (tem)))
+ into a REG_UNUSED note instead. Don't delete sets to
+ global register vars. */
+ if (reg_set_p (XEXP (note, 0), PATTERN (tem))
+ && !global_regs [REGNO(XEXP (note, 0))])
{
rtx set = single_set (tem);
rtx inner_dest = 0;