Re: [RFC PATCH] restrict_based_on_field attribute

2011-10-04 Thread Jakub Jelinek
On Tue, Oct 04, 2011 at 02:28:13PM -0400, Jason Merrill wrote: > This won't affect vectors that are passed by non-restrict reference, > correct? We don't want to break code that, say, takes the address It will ATM also affect global std::vector variables, and std::vector variables passed by invis

Re: [RFC PATCH] restrict_based_on_field attribute

2011-10-04 Thread Jason Merrill
This won't affect vectors that are passed by non-restrict reference, correct? We don't want to break code that, say, takes the address of an element and then uses it later unless we've made that invalid by marking the vector as restrict. Jason

Re: [RFC PATCH] restrict_based_on_field attribute

2011-10-04 Thread Richard Guenther
On Tue, Oct 4, 2011 at 3:28 PM, Jakub Jelinek wrote: > On Tue, Oct 04, 2011 at 01:55:27PM +0200, Michael Matz wrote: >> Ugh, that's stretching our fragile to unsafe restrict support quite much. >> IMO beyond what we can reasonably be confident to not cause >> miscompilations.  Essentially what you

Re: [RFC PATCH] restrict_based_on_field attribute

2011-10-04 Thread Michael Matz
Hi, On Tue, 4 Oct 2011, Jakub Jelinek wrote: > If it causes miscompilations, then GCC is buggy and needs to be fixed. That's not easy without effectively making the whole restrict support ineffective. > > Keep in mind that the whole current restrict-tag support was designed to > > support for

Re: [RFC PATCH] restrict_based_on_field attribute

2011-10-04 Thread Jakub Jelinek
On Tue, Oct 04, 2011 at 01:55:27PM +0200, Michael Matz wrote: > Ugh, that's stretching our fragile to unsafe restrict support quite much. > IMO beyond what we can reasonably be confident to not cause > miscompilations. Essentially what you're implicitely assuming is that the > sources of restr

Re: [RFC PATCH] restrict_based_on_field attribute

2011-10-04 Thread Richard Guenther
On Tue, Oct 4, 2011 at 1:55 PM, Michael Matz wrote: > Hi, > > On Mon, 3 Oct 2011, Jakub Jelinek wrote: > >> std::vector acts roughly as something having a restrict pointer field, >> i.e. two different std::vector objects will have the pointers pointing to >> a different array, unfortunately unlike

Re: [RFC PATCH] restrict_based_on_field attribute

2011-10-04 Thread Michael Matz
Hi, On Mon, 3 Oct 2011, Jakub Jelinek wrote: > std::vector acts roughly as something having a restrict pointer field, > i.e. two different std::vector objects will have the pointers pointing to > a different array, unfortunately unlike e.g. std::valarray we have 3 > different pointers pointing in

[RFC PATCH] restrict_based_on_field attribute

2011-10-03 Thread Jakub Jelinek
Hi! std::vector acts roughly as something having a restrict pointer field, i.e. two different std::vector objects will have the pointers pointing to a different array, unfortunately unlike e.g. std::valarray we have 3 different pointers pointing into the array instead of 1, and we can't change it