[PATCH] Fix C++ strict-aliasing issues with memcpy folding

Richard Guenther rguenther@suse.de
Mon Jan 25 16:45:00 GMT 2010


On Mon, 25 Jan 2010, Mark Mitchell wrote:

> Your further discussion involves GCC internals and limitations on what
> we do or do not know at various points in the compiler.  That's clearly
> important for practical purposes, but the first priority should be to
> decide what we want the language to mean.  Of course, it's likely that
> the compiler will have to be conservative (i.e., assume some worst-case
> situations when it cannot prove otherwise).  But, I think it's still
> valuable to understand on the language.

I don't think we can realistically say anything about the standard
apart from trying to extrapolate from its wording.  Neither me
nor Michael were involed in the standardization process.

What matters to me is practical effects on GCC internals and
its implementation.  I see a bug when trying to make grey-area
libstdc++ code conforming by using memcpy.  I, too, like
to understand that grey-area of the standard and like to learn
what its intent is here.  But still my first priority would
be to fix the obvious bug in GCC behavior (not honoring memcpy
as a series of accesses via an lvalue with character type).

Thanks,
Richard.



More information about the Gcc-patches mailing list