Re: Restrict implementation considered harmful

2008-11-21 Thread Richard Guenther
On Fri, Nov 21, 2008 at 10:14 PM, Daniel Berlin <[EMAIL PROTECTED]> wrote: > On Fri, Nov 21, 2008 at 2:23 PM, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: >> Michael Matz <[EMAIL PROTECTED]> writes: >> This program appears to me to be invalid according to C99 6.7.3.1, which is the only def

Re: Restrict implementation considered harmful

2008-11-21 Thread Daniel Berlin
On Fri, Nov 21, 2008 at 2:23 PM, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: > Michael Matz <[EMAIL PROTECTED]> writes: > >>> This program appears to me to be invalid according to C99 6.7.3.1, >>> which is the only definition of restrict that we have. >>> >>> If P is assigned the value of a poi

Re: Restrict implementation considered harmful

2008-11-21 Thread Ian Lance Taylor
Michael Matz <[EMAIL PROTECTED]> writes: >> This program appears to me to be invalid according to C99 6.7.3.1, >> which is the only definition of restrict that we have. >> >> If P is assigned the value of a pointer expression E that is based >> on another restricted pointer object P2, ass

Re: Restrict implementation considered harmful

2008-11-21 Thread Michael Matz
Hi, > This program appears to me to be invalid according to C99 6.7.3.1, > which is the only definition of restrict that we have. > > If P is assigned the value of a pointer expression E that is based > on another restricted pointer object P2, associated with block B2, > then either t

Re: Restrict implementation considered harmful

2008-11-21 Thread Ian Lance Taylor
Richard Guenther <[EMAIL PROTECTED]> writes: > int foo (int *__restrict p) > { > int *__restrict q; > int v; > q = p + 1; > q = q - 1; > v = *q; > *p = 1; > return v + *q; > } > extern void abort (void); > int main() > { > int i = 0; > if (foo (&i) != 1) > abort (); > retur

Re: Restrict implementation considered harmful

2008-11-21 Thread Richard Guenther
On Fri, 21 Nov 2008, Richard Guenther wrote: > On Fri, 21 Nov 2008, Jakub Jelinek wrote: > > > On Fri, Nov 21, 2008 at 08:31:18AM -0500, Diego Novillo wrote: > > > On Fri, Nov 21, 2008 at 06:21, Richard Guenther <[EMAIL PROTECTED]> wrote: > > > > > > > I think the only reasonable thing to do is

Re: Restrict implementation considered harmful

2008-11-21 Thread Richard Guenther
On Fri, 21 Nov 2008, Jakub Jelinek wrote: > On Fri, Nov 21, 2008 at 08:31:18AM -0500, Diego Novillo wrote: > > On Fri, Nov 21, 2008 at 06:21, Richard Guenther <[EMAIL PROTECTED]> wrote: > > > > > I think the only reasonable thing to do is to rip out the broken > > > restrict pointer handling comp

Re: Restrict implementation considered harmful

2008-11-21 Thread Jakub Jelinek
On Fri, Nov 21, 2008 at 08:31:18AM -0500, Diego Novillo wrote: > On Fri, Nov 21, 2008 at 06:21, Richard Guenther <[EMAIL PROTECTED]> wrote: > > > I think the only reasonable thing to do is to rip out the broken > > restrict pointer handling completely. > > > > Any better ideas? > > I will assume

Re: Restrict implementation considered harmful

2008-11-21 Thread Richard Guenther
On Fri, 21 Nov 2008, Diego Novillo wrote: > On Fri, Nov 21, 2008 at 06:21, Richard Guenther <[EMAIL PROTECTED]> wrote: > > > I think the only reasonable thing to do is to rip out the broken > > restrict pointer handling completely. > > > > Any better ideas? > > I will assume that this program is

Re: Restrict implementation considered harmful

2008-11-21 Thread Diego Novillo
On Fri, Nov 21, 2008 at 06:21, Richard Guenther <[EMAIL PROTECTED]> wrote: > I think the only reasonable thing to do is to rip out the broken > restrict pointer handling completely. > > Any better ideas? I will assume that this program is valid. I am not familiar enough with the restrict definit

Restrict implementation considered harmful

2008-11-21 Thread Richard Guenther
With looking at PRs 37742 and 37955 I reminded myself of our broken restrict implementation which tries to model restrict semantics within our type-based alias set framework. The implementation heavily relies on correct tracking of restrict bases (DECL_BASED_ON_RESTRICT_P/DECL_GET_RESTRICT_BASE)