+2004-06-22 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/15963
+ * expr.c (check_intrinsic_op): Allow comparison of characters.
+ Make logic easier.
+
2004-06-26 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
Andrew Vaught <andyv@firstinter.net>
case INTRINSIC_GE:
case INTRINSIC_LT:
case INTRINSIC_LE:
+ if ((*check_function) (e->op2) == FAILURE)
+ return FAILURE;
+
+ if (!(et0 (e->op1) == BT_CHARACTER && et0 (e->op2) == BT_CHARACTER)
+ && !(numeric_type (et0 (e->op1)) && numeric_type (et0 (e->op2))))
+ {
+ gfc_error ("Numeric or CHARACTER operands are required in "
+ "expression at %L", &e->where);
+ return FAILURE;
+ }
+ break;
case INTRINSIC_PLUS:
case INTRINSIC_MINUS:
if (!numeric_type (et0 (e->op1)) || !numeric_type (et0 (e->op2)))
goto not_numeric;
- if (e->operator != INTRINSIC_POWER)
- break;
-
- if (check_function == check_init_expr && et0 (e->op2) != BT_INTEGER)
+ if (e->operator == INTRINSIC_POWER
+ && check_function == check_init_expr && et0 (e->op2) != BT_INTEGER)
{
gfc_error ("Exponent at %L must be INTEGER for an initialization "
"expression", &e->op2->where);
+2004-06-25 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/15963
+ * gfortran.fortran-torture/execute/initialization_1.f90: New test.
+
2004-06-29 Richard Henderson <rth@redhat.com>
* gcc.dg/tree-ssa/20040430-1.c: Expect zero if's.
--- /dev/null
+! PR 15963 -- checks character comparison in initialization expressions
+character(8), parameter :: a(5) = (/ "H", "E", "L", "L", "O" /)
+call x(a)
+contains
+subroutine x(a)
+character(8), intent(in) :: a(:)
+integer :: b(count(a < 'F'))
+if (size(b) /= 1) call abort()
+end subroutine x
+end