diff options
Diffstat (limited to 'gcc/f/ste.c')
-rw-r--r-- | gcc/f/ste.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/f/ste.c b/gcc/f/ste.c index d7d84954eef..2ddf18118bf 100644 --- a/gcc/f/ste.c +++ b/gcc/f/ste.c @@ -1,5 +1,5 @@ /* 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. This file is part of GNU Fortran. @@ -2711,21 +2711,27 @@ ffeste_R810 (ffestw block, unsigned long casenum) do { texprlow = (c->low == NULL) ? NULL_TREE - : ffecom_constantunion (&ffebld_constant_union (c->low), s->type, - s->kindtype, - ffecom_tree_type[s->type][s->kindtype]); + : ffecom_constantunion_with_type (&ffebld_constant_union (c->low), + ffecom_tree_type[s->type][s->kindtype], c->low->consttype); if (c->low != c->high) { texprhigh = (c->high == NULL) ? NULL_TREE - : ffecom_constantunion (&ffebld_constant_union (c->high), - s->type, s->kindtype, - ffecom_tree_type[s->type][s->kindtype]); + : ffecom_constantunion_with_type (&ffebld_constant_union (c->high), + ffecom_tree_type[s->type][s->kindtype], c->high->consttype); pushok = pushcase_range (texprlow, texprhigh, convert, tlabel, &duplicate); } else 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; /* Unlink prev. */ c->previous_stmt->previous_stmt->next_stmt = c; |