This is the mail archive of the
mailing list for the GCC project.
Re: C++ PATCH: PR 16405
On Thu, Dec 23, 2004 at 08:17:35AM -0800, Mark Mitchell wrote:
> Richard Henderson wrote:
> >On Thu, Dec 23, 2004 at 12:12:45AM -0800, Mark Mitchell wrote:
> >>+ && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (pointer, 0)))
> >>+ == TYPE_MAIN_VARIANT (TREE_TYPE (*from_p))))
> I couldn't convince myself this was safe.
It's how we compare all other types for this sort of equality
all through the rest of the optimizers. Indeed, the default
version of the langhook is exactly this.
> >In some cases you'll wind
> >up invoking this memcpy before we even get to main. See the
> >sort of contortions we go through in gcc.c-torture/execute/builtins/
> >for testing this sort of thing.
> That's why I set i to zero in main.
No, I mean you won't make it into main to begin with if your
memcpy doesn't perform a copy, and return the correct value.