This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45586] [4.6 Regression] ICE non-trivial conversion at assignment
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 18 Jan 2011 13:37:53 +0000
- Subject: [Bug fortran/45586] [4.6 Regression] ICE non-trivial conversion at assignment
- Auto-submitted: auto-generated
- References: <bug-45586-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45586
--- Comment #31 from rguenther at suse dot de <rguenther at suse dot de> 2011-01-18 13:37:42 UTC ---
On Tue, 18 Jan 2011, mikael at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45586
>
> --- Comment #30 from Mikael Morin <mikael at gcc dot gnu.org> 2011-01-18 12:48:41 UTC ---
> (In reply to comment #28)
> > One way would be to keep for data types all the time the two versions around:
> > One with restrict and one without restrict;
> makes sense
>
> > thus, if one does type extension,
> > one has always a fully restrictless data type.
> Why? From my point of view type extension is orthogonal to target.
> If an entity of extended derived type has the target/pointer attribute, one
> uses the non-restrict variant for its base type, and if it hasn't one uses the
> restrict variant. Do I miss something?
>
> > Unfortunately, that seems to
> > cause a missed-optimization for
> > type t
> > integer :: a
> > integer, pointer :: b
> > end type t
> > type(t) :: x
> > as "x%a" cannot alias and only "x%b" can - but is seems that one cannot encode
> > this for the ME such that "t" as a whole has to be marked as unrestricted.
>
> How about:
>
> struct t_restrict {
> int a;
> int * b;
> } * restrict
>
> VS
>
> struct t_norestrict {
> int a;
> int * b;
> } *
>
> ?
Yes. The restrict qualifier on t_restrict * does not apply
to members, so as long as int *b is not restrict qualified
the b's alias.
> > I think the easiest would be to create for derived types sym->backend_decl and
> > another backend_decl with "restrict" - and propagate both variants types
> > through, when extending the type or including it into another type. As soon as
> > it is used as POINTER component, one could drop propagating the
> > backend_decl_restricted.
>
> Looks like a plan. :-)
I think Micha has started working on something.
Richard.