This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] PR 25075 Some conformance checks for intrinsics


Thomas Koenig wrote:
> +/* Compare the shape of a on dimension ai with the size of b on dimension
                  ^^^^^
> +   bi, returning 0 if they are known not to be identical, and 1 if
> +   they are identical, or if this cannot be determined.  */

'size' not shape; I think saying "compare the size along the dimension ..."
would be better.

> @@ -802,6 +830,16 @@ gfc_check_dot_product (gfc_expr * vector
>    if (rank_check (vector_b, 1, 1) == FAILURE)
>      return FAILURE;
>  
> +  if (! identical_dimen_shape (vector_a, 0, vector_b, 0))
> +    {
> +      gfc_error ("different shape for arguments '%s' and '%s' "
> +		 "at %L for intrinsic '%s'", gfc_current_intrinsic_arg[0],
> +		 gfc_current_intrinsic_arg[1],
> +		 &vector_a->where,
> +		 gfc_current_intrinsic);
> +      return FAILURE;
> +    }
> +

Here and below I don't see much sense in using gfc_current_intrinsic, instead
of hardcoding the values.  There are no other intrinsics that get the same
checking, aren't there?

> @@ -1461,13 +1499,36 @@ gfc_check_matmul (gfc_expr * matrix_a, g
...
>        break;
> -
> +      
>      case 2:

Spurious whitespace added.

This is ok, if you take these comments into account and if Steve doesn't object.

Thanks,
- Tobi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]