This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ISO Aliasing rules question
- From: Mark Mitchell <mark at codesourcery dot com>
- To: "law at redhat dot com" <law at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 21 Feb 2003 11:09:04 -0800
- Subject: Re: ISO Aliasing rules question
--On Friday, February 21, 2003 10:16:02 AM -0700 "law at redhat dot com"
<law at redhat dot com> wrote:
Is this correct? Or is my recollection of the ISO standard incorrect
here?
This is tricky. In general, you're right -- the structure of the type
doesn't matter, only the name.
But, then there's the "common initial sequence" stuff -- which doesn't
apply in your example, but can in other palces. See 6.5.2.3 in your C99
standard for details.
Bottom line: the optimization in the code you showed is correct.
--
Mark Mitchell mark at codesourcery dot com
CodeSourcery, LLC http://www.codesourcery.com