Hello world, this straightforward patch removes an unneeded ICE when we already had emitted a perfectly valid error message.
OK for trunk? Thomas 2007-12-16 Thomas Koenig <[EMAIL PROTECTED]> PR fortran/34305 * resolve.c (compare_bound): If either of the types of the arguments isn't INTEGER, return CMP_UNKNOWN. 2007-12-16 Thomas Koenig <[EMAIL PROTECTED]> PR fortran/34305 * gfortran.dg/real_dimension_1.f: New test case.
Index: resolve.c =================================================================== --- resolve.c (revision 130913) +++ resolve.c (working copy) @@ -3147,8 +3147,11 @@ compare_bound (gfc_expr *a, gfc_expr *b) || b == NULL || b->expr_type != EXPR_CONSTANT) return CMP_UNKNOWN; + /* If either of the types isn't INTEGER, we must have + raised an error earlier. */ + if (a->ts.type != BT_INTEGER || b->ts.type != BT_INTEGER) - gfc_internal_error ("compare_bound(): Bad expression"); + return CMP_UNKNOWN; i = mpz_cmp (a->value.integer, b->value.integer);
! { dg-do compile } ! PR 34305 - make sure there's an error message for specifying a program test parameter (datasize = 1000) dimension idata (datasize) ! { dg-error "must be of INTEGER type|must have constant shape" } idata (1) = -1 end