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: RFA: Fix rtl-optimization/22258


On Fri, Jul 01, 2005 at 06:01:41PM +0100, Joern RENNECKE wrote:
> Richard Henderson wrote:
> 
> >On Thu, Jun 30, 2005 at 08:25:29PM +0100, Joern RENNECKE wrote:
> > 
> >>+   /* Disregard parts of the return value that are set later.  */
> >>+   for (p = PREV_INSN (use); p != insn; p = PREV_INSN (p))
> >>+     {
> >>+       set = single_set (p);
> >>+       if (!set || !REG_P (SET_DEST (set)))
> >>+ 	continue;
[cut]
> 
> Index: combine.c
[...]
>   
> + struct likely_spilled_retval_info
> + {
> +   unsigned regno, nregs;
> +   unsigned mask;
> + };
> + 
> + /* Called via note_stores by likely_spilled_retval_p.  remove from info->mask
                                                           ^^^^^^
> +    hard registers that are known to be written to / clobbered in full.  */
> + static void
> + likely_spilled_retval_1 (rtx x, rtx set, void *data)
[...]
> +   new_mask = (2U << (nregs - 1)) - 1;
> +   if (regno < info->regno)
> +     new_mask >>= info->regno - regno;
> +   else
> +     new_mask <<= regno - info->regno;
> +   info->mask &= new_mask;
> + }

Shouldn't this be

	info->mask &= ~new_mask;

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

> + static int
> + likely_spilled_retval_p (rtx insn)
> + {
> +   rtx use = BB_END (this_basic_block);
> +   rtx reg, p;
[...]
> +   /* Disregard parts of the return value that are set later.  */
> +   info.regno = regno;
> +   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);

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.

-- 
Rask Ingemann Lambertsen


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