This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Fix rtl-optimization/22258
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: Joern RENNECKE <joern dot rennecke at st dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 3 Apr 2006 21:18:14 +0200
- Subject: Re: RFA: Fix rtl-optimization/22258
- References: <42C44729.1070207@st.com> <20050701064213.GA2225@redhat.com> <42C576F5.8060702@st.com>
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