aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2009-07-19 15:37:50 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2009-07-19 15:37:50 +0000
commit20562de4dfb0e8e1b65ae6c157032a480a2529dc (patch)
tree4f7f11dc223e021f749985c70b616d51d4261ca4 /gcc/fortran/check.c
parent16bff92192676901670042cdce3fbd5f9c928fc8 (diff)
downloadgcc-20562de4dfb0e8e1b65ae6c157032a480a2529dc.zip
gcc-20562de4dfb0e8e1b65ae6c157032a480a2529dc.tar.gz
gcc-20562de4dfb0e8e1b65ae6c157032a480a2529dc.tar.bz2
re PR fortran/40727 ([4.4] ICE gfc_simplify_dcmplx(): Bad type when passing BT_COMPLEX to cmplx)
2009-07-18 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/40727 * fortran/check.c (gfc_check_cmplx, gfc_check_dcmplx): Add check that the optional second argument isn't of COMPLEX type. 2009-07-18 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/40727 * gfortran.dg/intrinsic_cmplx.f90: New test. From-SVN: r149793
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r--gcc/fortran/check.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 8f949d2..e19f812 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -819,6 +819,15 @@ gfc_check_cmplx (gfc_expr *x, gfc_expr *y, gfc_expr *kind)
gfc_current_intrinsic, &y->where);
return FAILURE;
}
+
+ if (y->ts.type == BT_COMPLEX)
+ {
+ gfc_error ("'%s' argument of '%s' intrinsic at %L must have a type "
+ "of either REAL or INTEGER", gfc_current_intrinsic_arg[1],
+ gfc_current_intrinsic, &y->where);
+ return FAILURE;
+ }
+
}
if (kind_check (kind, 2, BT_COMPLEX) == FAILURE)
@@ -977,6 +986,14 @@ gfc_check_dcmplx (gfc_expr *x, gfc_expr *y)
gfc_current_intrinsic, &y->where);
return FAILURE;
}
+
+ if (y->ts.type == BT_COMPLEX)
+ {
+ gfc_error ("'%s' argument of '%s' intrinsic at %L must have a type "
+ "of either REAL or INTEGER", gfc_current_intrinsic_arg[1],
+ gfc_current_intrinsic, &y->where);
+ return FAILURE;
+ }
}
return SUCCESS;