This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch, fortran] PR36355: fix argument type checking for matmul
- From: "Daniel Franke" <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 28 May 2008 14:03:32 +0200
- Subject: [patch, fortran] PR36355: fix argument type checking for matmul
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:mime-version:content-type; bh=fdnkZzJRRhE7IFq7W+LV5KefOJ3HA07kZhWLsWrpqfQ=; b=lfm4W2dckg7TNe3mZcU1HQjXptEFsuCZr+BCCn3zlP5AeQJOM9oq9jWNbxBmPJ6F4nLuY/YnEKJR0H7xhR+XF9nBVbY1kr8kwyb8iiqyCW0FiHUIG0me+BE/vBSBigcnfubSzZWWAvLVohE4yJSOa6tXVTdgG1KjK03ikLAlx5I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:mime-version:content-type; b=qdkNDFAG0jr+IQ26XVO47SzHQM2ai87bCkwiF1b5tAMBbo8d/WYsueQ7jY47spIIpVsc7CJUMoABcjnPlMuWZyRbKac3DyMWlBngt8zDJce0F6Iy5P9LjpSzl71vA5kGHS+HzXG44GWERsqSc82MX2P/X2ckrZe1qODgyogf9Yo=
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],