diff --git a/gcc/ch/ChangeLog b/gcc/ch/ChangeLog index c3f6809a376..8356aa22a4a 100644 --- a/gcc/ch/ChangeLog +++ b/gcc/ch/ChangeLog @@ -1,3 +1,15 @@ +Sun Feb 4 15:52:44 2001 Richard Kenner + + * convert.c (convert): Call abort instead of fatal. + * except.c (pop_handler, chill_check_no_handlers): Likewise. + * expr.c (chill_expand_expr): Likewise. + * parse.c (peek_token_, pushback_token, require): Likewise. + * grant.c (write_grant_file): Call fatal_io_error instead of + pfatal_with_name. + * lex.c (init_parse, same_file, yywrap): Likewise. + * lang.c (GNU_xref_begin, GNU_xref_end): Deleted. + * lex.c (convert_bitstring): Delete check for alloca failure. + 2001-01-28 Kaveh R. Ghazi * ch-tree.h (integer_minus_one_node): Moved to top level gcc diff --git a/gcc/ch/convert.c b/gcc/ch/convert.c index dcea057f500..e7c93109bd0 100644 --- a/gcc/ch/convert.c +++ b/gcc/ch/convert.c @@ -1,5 +1,5 @@ /* Language-level data type conversion for GNU CHILL. - Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000 + Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -1135,11 +1135,12 @@ convert (type, expr) { if (TREE_CODE (type) == SET_TYPE) return digest_powerset_tuple (type, e); - if (TREE_CODE (type) == RECORD_TYPE) + else if (TREE_CODE (type) == RECORD_TYPE) return digest_structure_tuple (type, e); - if (TREE_CODE (type) == ARRAY_TYPE) + else if (TREE_CODE (type) == ARRAY_TYPE) return digest_array_tuple (type, e, 0); - fatal ("internal error - bad CONSTRUCTOR passed to convert"); + else + abort (); } else if (TREE_CODE (e) == COND_EXPR) e = build (COND_EXPR, type, diff --git a/gcc/ch/except.c b/gcc/ch/except.c index c1b85dffea6..b32dba60636 100644 --- a/gcc/ch/except.c +++ b/gcc/ch/except.c @@ -1,6 +1,6 @@ /* Exception support for GNU CHILL. WARNING: Only works for native (needs setjmp.h)! FIXME! - Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000 + Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -361,8 +361,9 @@ pop_handler (used) if (pass == 1) { struct handler_state *old = current_handler; + if (old == NULL) - fatal ("internal error: on stack out of sync"); + abort (); current_handler = old->next; if (used) @@ -539,7 +540,7 @@ void chill_check_no_handlers () { if (current_handler != NULL) - fatal ("internal error: on stack not empty when done"); + abort (); } static void diff --git a/gcc/ch/expr.c b/gcc/ch/expr.c index 40f74a42af0..59371e820db 100644 --- a/gcc/ch/expr.c +++ b/gcc/ch/expr.c @@ -1,6 +1,6 @@ /* Convert language-specific tree expression to rtl instructions, for GNU CHILL compiler. - Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000 + Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -390,19 +390,20 @@ chill_expand_expr (exp, target, tmode, modifier) { tree type0 = TREE_TYPE (exp0); tree type1 = TREE_TYPE (exp1); - int len0 = int_size_in_bytes (type0); - int len1 = int_size_in_bytes (type1); + HOST_WIDE_INT len0 = int_size_in_bytes (type0); + HOST_WIDE_INT len1 = int_size_in_bytes (type1); if (len0 < 0 && TYPE_ARRAY_MAX_SIZE (type0) - && TREE_CODE (TYPE_ARRAY_MAX_SIZE (type0)) == INTEGER_CST) - len0 = TREE_INT_CST_LOW (TYPE_ARRAY_MAX_SIZE (type0)); + && host_integerp (TYPE_ARRAY_MAX_SIZE (type0), 1)) + len0 = tree_low_cst (TYPE_ARRAY_MAX_SIZE (type0), 1); if (len1 < 0 && TYPE_ARRAY_MAX_SIZE (type1) - && TREE_CODE (TYPE_ARRAY_MAX_SIZE (type1)) == INTEGER_CST) - len1 = TREE_INT_CST_LOW (TYPE_ARRAY_MAX_SIZE (type1)); + && host_integerp (TYPE_ARRAY_MAX_SIZE (type1), 1)) + len1 = tree_low_cst (TYPE_ARRAY_MAX_SIZE (type1), 1); if (len0 < 0 || len1 < 0) - fatal ("internal error - don't know how much space is needed for concatenation"); + abort (); + target = assign_stack_temp (mode, len0 + len1, 0); preserve_temp_slots (target); } diff --git a/gcc/ch/grant.c b/gcc/ch/grant.c index 42328c122a8..29e7ddc1bb5 100644 --- a/gcc/ch/grant.c +++ b/gcc/ch/grant.c @@ -1,6 +1,6 @@ /* Implement grant-file output & seize-file input for CHILL. - Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, - 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. This file is part of GNU CC. @@ -2648,7 +2648,7 @@ write_grant_file () fb = fopen (grant_file_name, "w"); if (fb == NULL) - pfatal_with_name (grant_file_name); + fatal_io_error ("can't open %s", grant_file_name); /* write file. Due to problems with record sizes on VAX/VMS write string to '\n' */ @@ -2670,9 +2670,10 @@ write_grant_file () if (write (fileno (fb), gstring->str, gstring->len) < 0) { int save_errno = errno; + unlink (grant_file_name); errno = save_errno; - pfatal_with_name (grant_file_name); + fatal_io_error ("can't write to %s", grant_file_name); } #endif fclose (fb); diff --git a/gcc/ch/lang.c b/gcc/ch/lang.c index fbb646bca51..0c493b70bfe 100644 --- a/gcc/ch/lang.c +++ b/gcc/ch/lang.c @@ -1,5 +1,5 @@ /* Language-specific hook definitions for CHILL front end. - Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000 + Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -148,18 +148,6 @@ lang_print_xnode (file, node, indent) int indent ATTRIBUTE_UNUSED; { } - -void -GNU_xref_begin () -{ - fatal ("GCC does not yet support XREF"); -} - -void -GNU_xref_end () -{ - fatal ("GCC does not yet support XREF"); -} /* * process chill-specific compiler command-line options diff --git a/gcc/ch/lex.c b/gcc/ch/lex.c index f747bef570a..1a87025baae 100644 --- a/gcc/ch/lex.c +++ b/gcc/ch/lex.c @@ -1,5 +1,5 @@ /* Lexical analyzer for GNU CHILL. -*- C -*- - Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000 + Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -212,8 +212,9 @@ init_parse (filename) } else finput = fopen (filename, "r"); + if (finput == 0) - pfatal_with_name (filename); + fatal_io_error ("can't open %s", filename); #ifdef IO_BUFFER_SIZE setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE); @@ -1288,7 +1289,6 @@ convert_bitstring (p) /* Move p to stack so we can re-use temporary_obstack for result. */ char *oldp = (char*) alloca (strlen (p) + 1); - if (oldp == 0) fatal ("stack space exhausted"); strcpy (oldp, p); obstack_free (&temporary_obstack, p); p = oldp; @@ -1378,16 +1378,16 @@ same_file (filename1, filename2) for (i = 0; i < 2; i++) { stat_status = stat (fn_input[i], &s[i]); - if (stat_status < 0 && - strchr (fn_input[i], '/') == 0) + if (stat_status < 0 + && strchr (fn_input[i], '/') == 0) { STRING_LIST *plp; - char *path; + char *path; for (plp = seize_path_list; plp != 0; plp = plp->next) { - path = (char *)xmalloc (strlen (fn_input[i]) + - strlen (plp->str) + 2); + path = (char *) xmalloc (strlen (fn_input[i]) + + strlen (plp->str) + 2); sprintf (path, "%s/%s", plp->str, fn_input[i]); stat_status = stat (path, &s[i]); free (path); @@ -1395,8 +1395,9 @@ same_file (filename1, filename2) break; } } + if (stat_status < 0) - pfatal_with_name (fn_input[i]); + fatal_io_error ("can't find %s", fn_input[i]); } return s[0].st_ino == s[1].st_ino && s[0].st_dev == s[1].st_dev; } @@ -2190,7 +2191,7 @@ yywrap () } if (grt_in == NULL) - pfatal_with_name (seizefile_name_chars); + fatal_io_error ("can't open %s", seizefile_name_chars); finput = grt_in; input_filename = seizefile_name_chars; diff --git a/gcc/ch/parse.c b/gcc/ch/parse.c index 74e10c20174..afcf1427fd8 100644 --- a/gcc/ch/parse.c +++ b/gcc/ch/parse.c @@ -1,5 +1,5 @@ /* Parser for GNU CHILL (CCITT High-Level Language) -*- C -*- - Copyright (C) 1992, 1993, 1998, 1999, 2000 + Copyright (C) 1992, 1993, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -278,14 +278,15 @@ PEEK_TOKEN() return terminal_buffer[0]; } #define PEEK_TREE() val_buffer[0].ttype -#define PEEK_TOKEN1() peek_token_(1) -#define PEEK_TOKEN2() peek_token_(2) +#define PEEK_TOKEN1() peek_token_ (1) +#define PEEK_TOKEN2() peek_token_ (2) + static int peek_token_ (i) int i; { if (i > MAX_LOOK_AHEAD) - fatal ("internal error - too much lookahead"); + abort (); if (terminal_buffer[i] == TOKEN_NOT_READ) { terminal_buffer[i] = yylex(); @@ -301,7 +302,7 @@ pushback_token (code, node) { int i; if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ) - fatal ("internal error - cannot pushback token"); + abort (); for (i = MAX_LOOK_AHEAD; i > 0; i--) { terminal_buffer[i] = terminal_buffer[i - 1]; @@ -322,17 +323,17 @@ forward_token_() } terminal_buffer[MAX_LOOK_AHEAD] = TOKEN_NOT_READ; } -#define FORWARD_TOKEN() forward_token_() +#define FORWARD_TOKEN() forward_token_ () /* Skip the next token. if it isn't TOKEN, the parser is broken. */ static void -require(token) +require (token) enum terminal token; { if (PEEK_TOKEN() != token) - fatal ("internal parser error - expected token %d", (int)token); + internal_error ("internal parser error - expected token %d", (int) token); FORWARD_TOKEN(); }