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]

RFA: fix bugs in likely_spilled_retval_1 / likely_spilled_retval_p (Was: Re: RFA: Fix rtl-optimization/22258)


Rask Ingemann Lambertsen wrote:



Shouldn't this be

info->mask &= ~new_mask;

instead, to remove the bits in new_mask from info->mask?



...

When compared with your original patch, shouldn't this call notes_stores() on
P rather than on INSN (guarded by INSN_P())?

See <URL:http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00041.html> for the
whole message that I'm replying to. The patch was commited as revision
102279.


I have made this into an actual patch and successfully regression tested it on i686-pc-linux-gnu X sh-elf.
I can't do a bootstrap regression test because mainline doesn't bootstrap on my host, see
http://gcc.gnu.org/ml/gcc/2006-04/msg00055.html


:ADDPATCH rtl-optimization:

2006-04-05  Rask Ingemann Lambertsen <rask@sygehus.dk>
	    J"orn Rennecke <joern.rennecke@st.com>

	* combine.c (likely_spilled_retval_1): Fix masking operation.
	(likely_spilled_retval_p): Use proper pattern for call to
	likely_spilled_retval_1.

Index: combine.c
===================================================================
/usr/bin/diff -p -d -F^( -u -L combine.c	(revision 112638) -L combine.c	(working copy) .svn/text-base/combine.c.svn-base combine.c
--- combine.c	(revision 112638)
+++ combine.c	(working copy)
@@ -1646,7 +1646,7 @@ likely_spilled_retval_1 (rtx x, rtx set,
     new_mask >>= info->regno - regno;
   else
     new_mask <<= regno - info->regno;
-  info->mask &= new_mask;
+  info->mask &= ~new_mask;
 }
 
 /* Return nonzero iff part of the return value is live during INSN, and
@@ -1682,7 +1682,8 @@ likely_spilled_retval_p (rtx insn)
   info.nregs = nregs;
   info.mask = mask;
   for (p = PREV_INSN (use); info.mask && p != insn; p = PREV_INSN (p))
-    note_stores (PATTERN (insn), likely_spilled_retval_1, &info);
+    if (INSN_P (p))
+      note_stores (PATTERN (p), likely_spilled_retval_1, &info);
   mask = info.mask;
 
   /* Check if any of the (probably) live return value registers is

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