Re: [PATCH][RFC] Adjust the middle-end memory model

2009-05-22 Thread Mark Mitchell
Richard Guenther wrote: > Yes, that's the primary motivation of this patch. Can I take this > as an approval for the C++ frontend changes? OK. -- Mark Mitchell CodeSourcery m...@codesourcery.com (650) 331-3385 x713

Re: [PATCH][RFC] Adjust the middle-end memory model

2009-05-22 Thread Richard Guenther
On Wed, 20 May 2009, Mark Mitchell wrote: > Richard Guenther wrote: > > > int i; > > float f; > > void foo() > > { > > int *p = (int *)malloc(sizeof(int)); > > *p = 1; > > i = *p; > > float *q = (float *)p; > > *q = 2.0; > > f = *q; > > } > > Yes, I think that's a valid program too.

Re: [PATCH][RFC] Adjust the middle-end memory model

2009-05-20 Thread Mark Mitchell
Richard Guenther wrote: > int i; > float f; > void foo() > { > int *p = (int *)malloc(sizeof(int)); > *p = 1; > i = *p; > float *q = (float *)p; > *q = 2.0; > f = *q; > } Yes, I think that's a valid program too. I'm OK with giving up this optimization; clearly we need to be correct f

Re: [PATCH][RFC] Adjust the middle-end memory model

2009-05-20 Thread Richard Guenther
On Wed, 20 May 2009, Mark Mitchell wrote: > Richard Guenther wrote: > > >> void f(float *f, int *n) { > >> for (int i = 0; i < *n; ++i) { > >> f[i] *= 2; > >> } > >> } > > > The difference is if you want to sink a load from *n beyond the > > store to f[i] - in which case you as

Re: [PATCH][RFC] Adjust the middle-end memory model

2009-05-20 Thread Mark Mitchell
Richard Guenther wrote: >> void f(float *f, int *n) { >> for (int i = 0; i < *n; ++i) { >> f[i] *= 2; >> } >> } > The difference is if you want to sink a load from *n beyond the > store to f[i] - in which case you ask if there is an anti-dependence > which we cannot exclude in t

Re: [PATCH][RFC] Adjust the middle-end memory model

2009-05-20 Thread Richard Guenther
On Tue, 19 May 2009, Mark Mitchell wrote: > Richard Guenther wrote: > > >> - The tree alias oracle got similar functionality, refs_anti_dependent > >>and refs_output_dependent and the tree level data dependence > >>analysis code makes use of these. > > Do we still use TBAA for the origi

Re: [PATCH][RFC] Adjust the middle-end memory model

2009-05-19 Thread Mark Mitchell
Richard Guenther wrote: >> - The tree alias oracle got similar functionality, refs_anti_dependent >>and refs_output_dependent and the tree level data dependence >>analysis code makes use of these. Do we still use TBAA for the original motivating reason for adding it, e.g.,: void f(flo

Re: [PATCH][RFC] Adjust the middle-end memory model

2009-05-19 Thread Richard Guenther
On Fri, 8 May 2009, Richard Guenther wrote: > > This adjusts the middle-end memory model to properly honor type-based > aliasing rules set by the C and C++ standards. > > The bulk of the patch gets rid of our previous attempts to fix > the issues around placement new and friends, CHANGE_DYNAMIC_