diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2002-03-25 20:52:28 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2002-03-25 20:52:28 +0000 |
commit | 15e5ad7698ca582197d816b0e864d55bc0bdb607 (patch) | |
tree | 8c35b0cf468101ecc396f5eb7631e99dc328e79c /gcc/java/lex.c | |
parent | 99ffa1e37aad3fafd771f47b56c0085ce5544727 (diff) | |
download | gcc-15e5ad7698ca582197d816b0e864d55bc0bdb607.zip gcc-15e5ad7698ca582197d816b0e864d55bc0bdb607.tar.gz gcc-15e5ad7698ca582197d816b0e864d55bc0bdb607.tar.bz2 |
toplev.c: Don't include setjmp.h.
* toplev.c: Don't include setjmp.h. Kill float_handler_set,
float_handled, float_handler, float_signal, set_float_handler,
and do_float_handler. Set handler for SIGFPE to crash_signal.
* toplev.h: Don't prototype do_float_handler.
* c-lex.c: Fold parse_float into lex_number. Make warning
about portability of hex float constants more informative, and
don't issue it on top of a syntax error.
* fold-const.c: Fold const_binop_1 and fold_convert_1 into
their callers.
* real.h: Define REAL_VALUE_ABS here...
* simplify-rtx.c: ... not here. Fold check_fold_consts,
simplify_unary_real, simplify_binary_real, and
simplify_binary_is2orm1 into their callers.
* tree.c: Fold build_real_from_int_cst_1 into caller.
* doc/tm.texi: Document REAL_VALUE_ABS and REAL_VALUE_NEGATIVE.
* tsystem.h: Include float.h here...
* libgcc2.c: ... not here.
java:
* lex.c: Change java_perform_atof to take normal parameters
instead of a pointer to a parameter block. Call it directly
from java_lex.
testsuite:
* gcc.dg/c90-hexfloat-1.c: Adjust error regexps.
From-SVN: r51336
Diffstat (limited to 'gcc/java/lex.c')
-rw-r--r-- | gcc/java/lex.c | 53 |
1 files changed, 19 insertions, 34 deletions
diff --git a/gcc/java/lex.c b/gcc/java/lex.c index 6e255d1..8c66118 100644 --- a/gcc/java/lex.c +++ b/gcc/java/lex.c @@ -828,38 +828,33 @@ java_parse_escape_sequence () } } -/* Isolate the code which may raise an arithmetic exception in its - own function. */ - #ifndef JC1_LITE -struct jpa_args -{ - YYSTYPE *java_lval; - char *literal_token; - int fflag; - int number_beginning; -}; - #define IS_ZERO(X) (ereal_cmp (X, dconst0) == 0) -static void java_perform_atof PARAMS ((PTR)); +/* Subroutine of java_lex: converts floating-point literals to tree + nodes. LITERAL_TOKEN is the input literal, JAVA_LVAL is where to + store the result. FFLAG indicates whether the literal was tagged + with an 'f', indicating it is of type 'float'; NUMBER_BEGINNING + is the line number on which to report any error. */ + +static void java_perform_atof PARAMS ((YYSTYPE *, char *, int, int)); static void -java_perform_atof (av) - PTR av; +java_perform_atof (java_lval, literal_token, fflag, number_beginning) + YYSTYPE *java_lval; + char *literal_token; + int fflag; + int number_beginning; { - struct jpa_args *a = (struct jpa_args *)av; - YYSTYPE *java_lval = a->java_lval; - int number_beginning = a->number_beginning; REAL_VALUE_TYPE value; - tree type = (a->fflag ? FLOAT_TYPE_NODE : DOUBLE_TYPE_NODE); + tree type = (fflag ? FLOAT_TYPE_NODE : DOUBLE_TYPE_NODE); SET_REAL_VALUE_ATOF (value, - REAL_VALUE_ATOF (a->literal_token, TYPE_MODE (type))); + REAL_VALUE_ATOF (literal_token, TYPE_MODE (type))); if (REAL_VALUE_ISINF (value) || REAL_VALUE_ISNAN (value)) { - JAVA_FLOAT_RANGE_ERROR ((a->fflag ? "float" : "double")); + JAVA_FLOAT_RANGE_ERROR (fflag ? "float" : "double"); value = DCONST0; } else if (IS_ZERO (value)) @@ -867,7 +862,7 @@ java_perform_atof (av) /* We check to see if the value is really 0 or if we've found an underflow. We do this in the most primitive imaginable way. */ int really_zero = 1; - char *p = a->literal_token; + char *p = literal_token; if (*p == '-') ++p; while (*p && *p != 'e' && *p != 'E') @@ -1161,9 +1156,6 @@ java_lex (java_lval) } else { -#ifndef JC1_LITE - struct jpa_args a; -#endif if (stage != 4) /* Don't push back fF/dD. */ java_unget_unicode (); @@ -1176,17 +1168,10 @@ java_lex (java_lval) JAVA_LEX_LIT (literal_token, radix); #ifndef JC1_LITE - a.literal_token = literal_token; - a.fflag = fflag; - a.java_lval = java_lval; - a.number_beginning = number_beginning; - if (do_float_handler (java_perform_atof, (PTR) &a)) - return FP_LIT_TK; - - JAVA_FLOAT_RANGE_ERROR ((fflag ? "float" : "double")); -#else - return FP_LIT_TK; + java_perform_atof (java_lval, literal_token, + fflag, number_beginning); #endif + return FP_LIT_TK; } } } /* JAVA_ASCII_FPCHAR (c) */ |