------- Comment #4 from jaydub66 at gmail dot com  2008-04-10 21:09 -------
To me it's also not completely clear what the standard says on this, but the
way to fix it would probably be to insert some additional check into
operator_correspondence (interface.c), where currently only the type and rank
of the arguments is checked.


To require full equality of all array borders (as suggested in my comment #2),
one could simply add

      if (!gfc_compare_array_spec (f1->sym->as, f2->sym->as))
        return 1;

into the above mentioned routine. This would result in gfortran behaving the
same way as ifort in this case, may it be standard-conforming or not.


If on the other hand Tobias is right in the assumption he made in comment #3,
then one could something along the lines of

  if (f1->sym->as->type != f2->sym->as->type)
    return 1;

to require only the array types to be equal, or something similar to at least
prevent assumed-shape arrays from being passed instead of eplicit-shape arrays.


My feeling is that at least the array size should match for explicit-shape
arrays, but this is just a feeling and I couldn't find anything in the standard
to confirm this.

I'm not sure if the changes I'm suggesting would interfere with any other case
where 'operator_correspondence' is called, but at least they don't seem to
trigger any regressions.


-- 


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

Reply via email to