This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[patch, fortran] PR36355: fix argument type checking for matmul


The diagnosed error is correct, but gives the wrong argument name as
the culprit (see PR for an example). The fix is quite obvious, I will
commit it in 24 h ours if there are no objections.


2008-05-28  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/36355
        * check.c (gfc_check_matmul): Fixed argument type checking.


Regression tested on i686-pc-linux-gnu.

Regards

      Daniel
Index: check.c
===================================================================
--- check.c	(revision 136058)
+++ check.c	(working copy)
@@ -1761,7 +1761,7 @@ gfc_check_malloc (gfc_expr *size)
 try
 gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
 {
-  if ((matrix_a->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_b->ts))
+  if ((matrix_a->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_a->ts))
     {
       gfc_error ("'%s' argument of '%s' intrinsic at %L must be numeric "
 		 "or LOGICAL", gfc_current_intrinsic_arg[0],
@@ -1769,7 +1769,7 @@ gfc_check_matmul (gfc_expr *matrix_a, gf
       return FAILURE;
     }
 
-  if ((matrix_b->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_a->ts))
+  if ((matrix_b->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_b->ts))
     {
       gfc_error ("'%s' argument of '%s' intrinsic at %L must be numeric "
 		 "or LOGICAL", gfc_current_intrinsic_arg[1],

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