http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45586

--- Comment #29 from Michael Matz <matz at gcc dot gnu.org> 2011-01-17 13:52:20 
UTC ---
> It is, btw, a sign of bad Fortran language design

I don't see that.  The frontend merely needs to emit correctly typed
expressions.  And that the type of 'a%b%ptr%d' depends on the prefix
'a%b%ptr' is no wonder and happens with most languages.

> and makes the point
> of the pointer/target attributes moot.

Not really.  The point being that non-pointer objects themself can't refer to
any other object, and that non-target objects can't be referred to by
anything else than their name or dummies.  So, as long as no pointer
is involved in an expression all is well.  And as soon as a pointer is
involved everything works automatically iff the pointer variable has the
correct type (namely a type with an implied target attribute everywhere,
which in frontend parlance is equivalent to a type without any restrict
markers applied).

> What we could do is drop restrict qualifications for all aggregate
> types.  At least such funny games do not seem possible with mere
> toplevel arrays or scalars, right?

IIRC the spec2k6 cases for which I added the restrict support were
using aggregate types :-/

Reply via email to