This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RTL alias analysis


On Jan 26, 2006, Richard Guenther <richard.guenther@gmail.com> wrote:

>> So it is perfectly valid, but if GCC reorders the read from *ip past
>> the store to *dp, it turns the valid program into one that misbehaves.

> *ip = 15; ii = *ip; *dp = 1.5; dd = *dp;
> Here                    ^^^
> you are accessing memory of type integer as type double.

Yes, but that's not what the Standard defines as undefined.  If the
stored value is accessed with a type that differs from the effective
type, then you lose.  But here it's not accessing the stored type;
quite the contrary, it's overwriting it, giving the underlying memory
a new effective type.  Please read 6.5/6-7.

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]