This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix C++ strict-aliasing issues with memcpy folding
- From: Gabriel Dos Reis <dosreis at gmail dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Richard Guenther <rguenther at suse dot de>, Richard Guenther <richard dot guenther at gmail dot com>, Paolo Bonzini <bonzini at gnu dot org>, gcc-patches at gcc dot gnu dot org, Diego Novillo <dnovillo at google dot com>
- Date: Tue, 2 Feb 2010 02:27:05 -0600
- Subject: Re: [PATCH] Fix C++ strict-aliasing issues with memcpy folding
- References: <alpine.LNX.2.00.1001221549140.7863@zhemvz.fhfr.qr> <4B5ABF96.1030804@gnu.org> <84fc9c001001230409xa74cab6iea45fa74da008bf@mail.gmail.com> <4B5AF989.6080002@gnu.org> <84fc9c001001230537lb8f5e9co42869f1965cc17cb@mail.gmail.com> <4B5C8C89.80108@codesourcery.com> <alpine.LNX.2.00.1001242151460.7863@zhemvz.fhfr.qr> <4B5CE256.9060802@codesourcery.com>
- Reply-to: gdr at integrable-solutions dot net
On Sun, Jan 24, 2010 at 6:14 PM, Mark Mitchell <mark@codesourcery.com> wrote:
> In that case, I don't think that "following the standard" is a useful
> thing to try to do. ?"Fix the standard" might be useful, of course.
> But, as an implementor, I think we should do something sensible. ?I'm
> very bothered by the idea that:
>
> ?int i;
> ?int *p = &i;
> ?// something
> ?*p = 3;
>
> might be invalid. ?That seems very wrong.
I cannot find any text that says that if 'p' still points
to the storage of 'i', then the above is invalid.
-- Gaby