This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/8165: builtin string functions SEGV on alpha-pc-linux-gnu at -O2
- From: Glen Nakamura <glen at imodulo dot com>
- To: Richard Henderson <rth at redhat dot com>, gcc-gnats at gcc dot gnu dot org,gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sat, 12 Oct 2002 08:39:25 -1000
- Subject: Re: optimization/8165: builtin string functions SEGV on alpha-pc-linux-gnu at -O2
- References: <20021008005507.14448.qmail@sources.redhat.com> <20021008012409.GA12645@modulo.internal.net> <20021008222053.GB2477@redhat.com> <20021008231326.GA13942@modulo.internal.net> <20021011224448.GA2764@redhat.com> <20021011231721.GA19668@modulo.internal.net> <20021012005143.GA3025@redhat.com>
On Fri, Oct 11, 2002 at 05:51:43PM -0700, Richard Henderson wrote:
> I guess your original patch is probably correct. I was
> focused so much on the LO_SUM/HIGH simplification that
> I missed the fact that we were failing to process the
> internal regs of the LO_SUM at all.
Looking at try_replace_reg() again, I noticed that the REG_EQUAL note
isn't always replaced. Is the "else" really okay?
static int
try_replace_reg (from, to, insn)
rtx from, to, insn;
{
rtx note = find_reg_equal_equiv_note (insn);
...
if (!success && set && reg_mentioned_p (from, SET_SRC (set)))
{
...
/* If we've failed to do replacement, have a single SET, and don't already
have a note, add a REG_EQUAL note to not lose information. */
if (!success && note == 0 && set != 0)
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}
/* If there is already a NOTE, update the expression in it with our
replacement. */
else if (note != 0)
^^^^
XEXP (note, 0) = simplify_replace_rtx (XEXP (note, 0), from, to);