Commit 425c1348 by Toon Moene

stc.c (ffestc_R810): Allow any kind integer in case statements.

2003-01-03  Bud Davis <bdavis11@directvinternet.com>

	* stc.c (ffestc_R810): Allow any kind integer in
	case statements.
	* ste.c (ffeste_R810): Give error message when
	case selector exceeds its valid values.

From-SVN: r60852
parent 4e8dca1c
This source diff could not be displayed because it is too large. You can view the blob instead.
/* stc.c -- Implementation File (module.c template V1.0) /* stc.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley. Contributed by James Craig Burley.
This file is part of GNU Fortran. This file is part of GNU Fortran.
...@@ -9195,18 +9195,13 @@ ffestc_R810 (ffesttCaseList cases, ffelexToken name) ...@@ -9195,18 +9195,13 @@ ffestc_R810 (ffesttCaseList cases, ffelexToken name)
ffebad_finish (); ffebad_finish ();
continue; continue;
} }
if (((caseobj->expr1 != NULL) if (((caseobj->expr1 != NULL)
&& ((ffeinfo_basictype (ffebld_info (caseobj->expr1)) && ((ffeinfo_basictype (ffebld_info (caseobj->expr1))
!= s->type) != s->type)))
|| (ffeinfo_kindtype (ffebld_info (caseobj->expr1))
!= s->kindtype)))
|| ((caseobj->range) || ((caseobj->range)
&& (caseobj->expr2 != NULL) && (caseobj->expr2 != NULL)
&& ((ffeinfo_basictype (ffebld_info (caseobj->expr2)) && ((ffeinfo_basictype (ffebld_info (caseobj->expr2))
!= s->type) != s->type))))
|| (ffeinfo_kindtype (ffebld_info (caseobj->expr2))
!= s->kindtype))))
{ {
ffebad_start (FFEBAD_CASE_TYPE_DISAGREE); ffebad_start (FFEBAD_CASE_TYPE_DISAGREE);
ffebad_here (0, ffelex_token_where_line (caseobj->t), ffebad_here (0, ffelex_token_where_line (caseobj->t),
......
/* ste.c -- Implementation File (module.c template V1.0) /* ste.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995, 1996, 2000, 2002 Free Software Foundation, Inc. Copyright (C) 1995, 1996, 2000, 2002, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley. Contributed by James Craig Burley.
This file is part of GNU Fortran. This file is part of GNU Fortran.
...@@ -2725,7 +2725,15 @@ ffeste_R810 (ffestw block, unsigned long casenum) ...@@ -2725,7 +2725,15 @@ ffeste_R810 (ffestw block, unsigned long casenum)
} }
else else
pushok = pushcase (texprlow, convert, tlabel, &duplicate); pushok = pushcase (texprlow, convert, tlabel, &duplicate);
assert (pushok == 0); assert((pushok !=2) || (pushok !=0));
if (pushok==2)
{
ffebad_start_msg ("SELECT (at %0) has duplicate cases -- check integer overflow of CASE(s)",
FFEBAD_severityFATAL);
ffebad_here (0, ffestw_line (block), ffestw_col (block));
ffebad_finish ();
ffestw_set_select_texpr (block, error_mark_node);
}
c = c->next_stmt; c = c->next_stmt;
/* Unlink prev. */ /* Unlink prev. */
c->previous_stmt->previous_stmt->next_stmt = c; c->previous_stmt->previous_stmt->next_stmt = c;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment