Re: Help understanding gcc alias analysis

2009-01-13 Thread Richard Guenther
On Mon, Jan 12, 2009 at 10:50 PM, Raoul Gough wrote: > Richard Guenther wrote: >> >> On Mon, Jan 12, 2009 at 12:03 AM, Raoul Gough >> wrote: >> >>> >>> Richard Guenther wrote: >>> > > [snip] This is also invalid. You have to use placement new to change the dynamic type of mem

Re: Help understanding gcc alias analysis

2009-01-12 Thread Raoul Gough
Richard Guenther wrote: On Mon, Jan 12, 2009 at 12:03 AM, Raoul Gough wrote: Richard Guenther wrote: [snip] This is also invalid. You have to use placement new to change the dynamic type of memory. Yes, I guess that makes sense. I've modified the example like this: #includ

Re: Help understanding gcc alias analysis

2009-01-12 Thread Richard Guenther
On Mon, Jan 12, 2009 at 12:03 AM, Raoul Gough wrote: > Richard Guenther wrote: >> >> On Sun, Jan 11, 2009 at 7:59 PM, Raoul Gough >> wrote: >> > > [snip] >>> >>> I guess the situation is more complicated in C++, which has explicit >>> destructors. Consider the following example, which is getting

Re: Help understanding gcc alias analysis

2009-01-11 Thread Raoul Gough
Richard Guenther wrote: On Sun, Jan 11, 2009 at 7:59 PM, Raoul Gough wrote: [snip] I guess the situation is more complicated in C++, which has explicit destructors. Consider the following example, which is getting closer to the problem that originally got me interested in this subject: voi

Re: Help understanding gcc alias analysis

2009-01-11 Thread Richard Guenther
On Sun, Jan 11, 2009 at 7:59 PM, Raoul Gough wrote: > Richard Guenther wrote: >> >> On Sat, Jan 10, 2009 at 12:55 PM, Richard Guenther >> wrote: >> >>> >>> On Sat, Jan 10, 2009 at 12:19 PM, Raoul Gough >>> wrote: >>> > > [snip] Here we pass into bar a pointer to int and double at the s

Re: Help understanding gcc alias analysis

2009-01-11 Thread Raoul Gough
Richard Guenther wrote: On Sat, Jan 10, 2009 at 12:55 PM, Richard Guenther wrote: On Sat, Jan 10, 2009 at 12:19 PM, Raoul Gough wrote: [snip] Here we pass into bar a pointer to int and double at the same storage location. So now, if the compiler goes ahead and reorders the read and w

Re: Help understanding gcc alias analysis

2009-01-10 Thread Richard Guenther
On Sat, Jan 10, 2009 at 12:55 PM, Richard Guenther wrote: > On Sat, Jan 10, 2009 at 12:19 PM, Raoul Gough wrote: >> I've been investigating a code-reordering question to do with g++ strict >> alias analysis, and I suspect there is a deficiency in the way type-based >> alias analysis works. I real

Re: Help understanding gcc alias analysis

2009-01-10 Thread Richard Guenther
On Sat, Jan 10, 2009 at 12:19 PM, Raoul Gough wrote: > I've been investigating a code-reordering question to do with g++ strict > alias analysis, and I suspect there is a deficiency in the way type-based > alias analysis works. I realise that's unlikely to be the case, so I'll try > to present a c

Help understanding gcc alias analysis

2009-01-10 Thread Raoul Gough
I've been investigating a code-reordering question to do with g++ strict alias analysis, and I suspect there is a deficiency in the way type-based alias analysis works. I realise that's unlikely to be the case, so I'll try to present a concise demonstration which uses (I think) well-defined C c