Commit 15e5ad76 by Zack Weinberg

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
parent 99ffa1e3
2002-03-25 Zack Weinberg <zack@codesourcery.com>
* 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.
2002-03-25 Nick Clifton <nickc@cambridge.redhat.com>
Fixes for: PR bootstrap/3591, target/5676
......
......@@ -921,20 +921,28 @@ package body Sem_Eval is
declare
Arr : constant Node_Id := Constant_Value (Entity (Prefix (Op)));
Sub : constant Node_Id := First (Expressions (Op));
Ind : constant Node_Id := First_Index (Etype (Arr));
Lbd : constant Node_Id := Type_Low_Bound (Etype (Ind));
Aty : constant Node_Id := Etype (Arr);
Lin : Nat;
-- Linear one's origin subscript value for array reference
Lbd : Node_Id;
-- Lower bound of the first array index
Elm : Node_Id;
-- Value from constant array
begin
if Ekind (Aty) = E_String_Literal_Subtype then
Lbd := String_Literal_Low_Bound (Aty);
else
Lbd := Type_Low_Bound (Etype (First_Index (Aty)));
end if;
if Compile_Time_Known_Value (Sub)
and then Nkind (Arr) = N_Aggregate
and then Compile_Time_Known_Value (Lbd)
and then Is_Discrete_Type (Component_Type (Etype (Arr)))
and then Is_Discrete_Type (Component_Type (Aty))
then
Lin := UI_To_Int (Expr_Value (Sub) - Expr_Value (Lbd)) + 1;
......
......@@ -84,7 +84,6 @@ int c_header_level; /* depth in C headers - C++ only */
/* Nonzero tells yylex to ignore \ in string constants. */
static int ignore_escape_flag;
static void parse_float PARAMS ((PTR));
static tree lex_number PARAMS ((const char *, unsigned int));
static tree lex_string PARAMS ((const unsigned char *, unsigned int,
int));
......@@ -703,67 +702,6 @@ struct try_type type_sequence[] =
};
#endif /* 0 */
struct pf_args
{
/* Input */
const char *str;
int fflag;
int lflag;
int base;
/* Output */
int conversion_errno;
REAL_VALUE_TYPE value;
tree type;
};
static void
parse_float (data)
PTR data;
{
struct pf_args * args = (struct pf_args *) data;
const char *typename;
args->conversion_errno = 0;
args->type = double_type_node;
typename = "double";
/* The second argument, machine_mode, of REAL_VALUE_ATOF
tells the desired precision of the binary result
of decimal-to-binary conversion. */
if (args->fflag)
{
if (args->lflag)
error ("both 'f' and 'l' suffixes on floating constant");
args->type = float_type_node;
typename = "float";
}
else if (args->lflag)
{
args->type = long_double_type_node;
typename = "long double";
}
else if (flag_single_precision_constant)
{
args->type = float_type_node;
typename = "float";
}
errno = 0;
if (args->base == 16)
args->value = REAL_VALUE_HTOF (args->str, TYPE_MODE (args->type));
else
args->value = REAL_VALUE_ATOF (args->str, TYPE_MODE (args->type));
args->conversion_errno = errno;
/* A diagnostic is required here by some ISO C testsuites.
This is not pedwarn, because some people don't want
an error for this. */
if (REAL_VALUE_ISINF (args->value) && pedantic)
warning ("floating point number exceeds range of '%s'", typename);
}
int
c_lex (value)
tree *value;
......@@ -974,14 +912,11 @@ lex_number (str, len)
if (floatflag != NOT_FLOAT)
{
tree type;
int imag, fflag, lflag, conversion_errno;
const char *typename;
int imag, fflag, lflag;
REAL_VALUE_TYPE real;
struct pf_args args;
char *copy;
if (base == 16 && pedantic && !flag_isoc99)
pedwarn ("floating constant may not be in radix 16");
if (base == 16 && floatflag != AFTER_EXPON)
ERROR ("hexadecimal floating constant has no exponent");
......@@ -1046,34 +981,45 @@ lex_number (str, len)
ERROR ("invalid suffix on floating constant");
}
/* Setup input for parse_float() */
args.str = copy;
args.fflag = fflag;
args.lflag = lflag;
args.base = base;
type = double_type_node;
typename = "double";
/* Convert string to a double, checking for overflow. */
if (do_float_handler (parse_float, (PTR) &args))
if (fflag)
{
if (lflag)
ERROR ("both 'f' and 'l' suffixes on floating constant");
type = float_type_node;
typename = "float";
}
else if (lflag)
{
type = long_double_type_node;
typename = "long double";
}
else if (flag_single_precision_constant)
{
/* Receive output from parse_float() */
real = args.value;
type = float_type_node;
typename = "float";
}
/* Warn about this only after we know we're not issuing an error. */
if (base == 16 && pedantic && !flag_isoc99)
pedwarn ("hexadecimal floating constants are only valid in C99");
/* The second argument, machine_mode, of REAL_VALUE_ATOF
tells the desired precision of the binary result
of decimal-to-binary conversion. */
if (base == 16)
real = REAL_VALUE_HTOF (copy, TYPE_MODE (type));
else
/* We got an exception from parse_float() */
ERROR ("floating constant out of range");
/* Receive output from parse_float() */
conversion_errno = args.conversion_errno;
type = args.type;
#ifdef ERANGE
/* ERANGE is also reported for underflow,
so test the value to distinguish overflow from that. */
if (conversion_errno == ERANGE && pedantic
&& (REAL_VALUES_LESS (dconst1, real)
|| REAL_VALUES_LESS (real, dconstm1)))
real = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
/* A diagnostic is required here by some ISO C testsuites.
This is not pedwarn, because some people don't want
an error for this. */
if (REAL_VALUE_ISINF (real) && pedantic)
warning ("floating point number exceeds range of 'double'");
#endif
/* Create a node with determined type and value. */
if (imag)
......
......@@ -7829,6 +7829,10 @@ decimal and hexadecimal floating point constants, using the syntax
defined by the C language for both.
@end deftypefn
@deftypefn Macro int REAL_VALUE_NEGATIVE (REAL_VALUE_TYPE @var{x})
Returns 1 if @var{x} is negative (including negative zero), 0 otherwise.
@end deftypefn
@deftypefn Macro int REAL_VALUE_ISINF (REAL_VALUE_TYPE @var{x})
Determines whether @var{x} represents infinity (positive or negative).
@end deftypefn
......@@ -7856,6 +7860,10 @@ target's floating point format cannot represent infinity, it will call
Returns the negative of the floating point value @var{x}.
@end deftypefn
@deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_ABS (REAL_VALUE_TYPE @var{x})
Returns the absolute value of @var{x}.
@end deftypefn
@deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_TRUNCATE (REAL_VALUE_TYPE @var{mode}, enum machine_mode @var{x})
Truncates the floating point value @var{x} to fit in @var{mode}. The
return value is still a full-size @code{REAL_VALUE_TYPE}, but it has an
......
......@@ -65,11 +65,9 @@ static tree split_tree PARAMS ((tree, enum tree_code, tree *, tree *,
int));
static tree associate_trees PARAMS ((tree, tree, enum tree_code, tree));
static tree int_const_binop PARAMS ((enum tree_code, tree, tree, int));
static void const_binop_1 PARAMS ((PTR));
static tree const_binop PARAMS ((enum tree_code, tree, tree, int));
static hashval_t size_htab_hash PARAMS ((const void *));
static int size_htab_eq PARAMS ((const void *, const void *));
static void fold_convert_1 PARAMS ((PTR));
static tree fold_convert PARAMS ((tree, tree));
static enum tree_code invert_tree_comparison PARAMS ((enum tree_code));
static enum tree_code swap_tree_comparison PARAMS ((enum tree_code));
......@@ -1199,32 +1197,6 @@ int_const_binop (code, arg1, arg2, notrunc)
return t;
}
/* Define input and output argument for const_binop_1. */
struct cb_args
{
enum tree_code code; /* Input: tree code for operation. */
tree type; /* Input: tree type for operation. */
REAL_VALUE_TYPE d1, d2; /* Input: floating point operands. */
tree t; /* Output: constant for result. */
};
/* Do the real arithmetic for const_binop while protected by a
float overflow handler. */
static void
const_binop_1 (data)
PTR data;
{
struct cb_args *args = (struct cb_args *) data;
REAL_VALUE_TYPE value;
REAL_ARITHMETIC (value, args->code, args->d1, args->d2);
args->t
= build_real (args->type,
real_value_truncate (TYPE_MODE (args->type), value));
}
/* Combine two constants ARG1 and ARG2 under operation CODE to produce a new
constant. We assume ARG1 and ARG2 have the same data type, or at least
are the same kind of constant and the same machine mode.
......@@ -1247,9 +1219,8 @@ const_binop (code, arg1, arg2, notrunc)
{
REAL_VALUE_TYPE d1;
REAL_VALUE_TYPE d2;
int overflow = 0;
REAL_VALUE_TYPE value;
tree t;
struct cb_args args;
d1 = TREE_REAL_CST (arg1);
d2 = TREE_REAL_CST (arg2);
......@@ -1261,24 +1232,14 @@ const_binop (code, arg1, arg2, notrunc)
else if (REAL_VALUE_ISNAN (d2))
return arg2;
/* Setup input for const_binop_1() */
args.type = TREE_TYPE (arg1);
args.d1 = d1;
args.d2 = d2;
args.code = code;
REAL_ARITHMETIC (value, code, d1, d2);
if (do_float_handler (const_binop_1, (PTR) &args))
/* Receive output from const_binop_1. */
t = args.t;
else
{
/* We got an exception from const_binop_1. */
t = copy_node (arg1);
overflow = 1;
}
t = build_real (TREE_TYPE (arg1),
real_value_truncate (TYPE_MODE (TREE_TYPE (arg1)),
value));
TREE_OVERFLOW (t)
= (force_fit_type (t, overflow)
= (force_fit_type (t, 0)
| TREE_OVERFLOW (arg1) | TREE_OVERFLOW (arg2));
TREE_CONSTANT_OVERFLOW (t)
= TREE_OVERFLOW (t)
......@@ -1530,27 +1491,6 @@ size_diffop (arg0, arg1)
convert (ctype, size_binop (MINUS_EXPR, arg1, arg0)));
}
/* This structure is used to communicate arguments to fold_convert_1. */
struct fc_args
{
tree arg1; /* Input: value to convert. */
tree type; /* Input: type to convert value to. */
tree t; /* Output: result of conversion. */
};
/* Function to convert floating-point constants, protected by floating
point exception handler. */
static void
fold_convert_1 (data)
PTR data;
{
struct fc_args *args = (struct fc_args *) data;
args->t = build_real (args->type,
real_value_truncate (TYPE_MODE (args->type),
TREE_REAL_CST (args->arg1)));
}
/* Given T, a tree representing type conversion of ARG1, a constant,
return a constant tree representing the result of conversion. */
......@@ -1650,8 +1590,6 @@ fold_convert (t, arg1)
return build_real_from_int_cst (type, arg1);
if (TREE_CODE (arg1) == REAL_CST)
{
struct fc_args args;
if (REAL_VALUE_ISNAN (TREE_REAL_CST (arg1)))
{
t = arg1;
......@@ -1659,24 +1597,12 @@ fold_convert (t, arg1)
return t;
}
/* Setup input for fold_convert_1() */
args.arg1 = arg1;
args.type = type;
if (do_float_handler (fold_convert_1, (PTR) &args))
{
/* Receive output from fold_convert_1() */
t = args.t;
}
else
{
/* We got an exception from fold_convert_1() */
overflow = 1;
t = copy_node (arg1);
}
t = build_real (type,
real_value_truncate (TYPE_MODE (type),
TREE_REAL_CST (arg1)));
TREE_OVERFLOW (t)
= TREE_OVERFLOW (arg1) | force_fit_type (t, overflow);
= TREE_OVERFLOW (arg1) | force_fit_type (t, 0);
TREE_CONSTANT_OVERFLOW (t)
= TREE_OVERFLOW (t) | TREE_CONSTANT_OVERFLOW (arg1);
return t;
......
2002-03-25 Zack Weinberg <zack@codesourcery.com>
* lex.c: Change java_perform_atof to take normal parameters
instead of a pointer to a parameter block. Call it directly
from java_lex.
2002-03-22 Mark Wielaard <mark@klomp.org>
Fix for PR java/5368:
......
......@@ -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) */
......
......@@ -1065,11 +1065,8 @@ __floatdidf (DWtype u)
#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
#define HIGH_HALFWORD_COEFF (((UDWtype) 1) << (WORD_SIZE / 2))
#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
#define DI_SIZE (sizeof (DWtype) * BITS_PER_UNIT)
/* GCC guarantees this header exists at this point. */
#include <float.h>
#define DI_SIZE (sizeof (DWtype) * BITS_PER_UNIT)
#define DF_SIZE DBL_MANT_DIG
#define SF_SIZE FLT_MANT_DIG
......
......@@ -161,6 +161,10 @@ extern REAL_VALUE_TYPE real_value_truncate PARAMS ((enum machine_mode,
#define REAL_VALUE_NEGATE ereal_negate
/* Compute the absolute value of a floating-point value X. */
#define REAL_VALUE_ABS(x) \
(REAL_VALUE_NEGATIVE (x) ? REAL_VALUE_NEGATE (x) : (x))
/* Determine whether a floating-point value X is infinite. */
#define REAL_VALUE_ISINF(x) (target_isinf (x))
......
2002-03-25 Zack Weinberg <zack@codesourcery.com>
* gcc.dg/c90-hexfloat-1.c: Adjust error regexps.
2002-03-25 Bob Wilson <bob.wilson@acm.org>
* g++.old-deja/g++.jason/thunk3.C: Add xtensa-*-* to list of
......
......@@ -4,8 +4,8 @@
/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
double d = 0x1.2p2; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "radix 16" "hex float error" { target *-*-* } 6 } */
/* { dg-error "hexadecimal floating" "hex float error" { target *-*-* } 6 } */
double d1 = 0x1p2; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "radix 16" "hex float error" { target *-*-* } 8 } */
/* { dg-error "hexadecimal floating" "hex float error" { target *-*-* } 8 } */
double d2 = 0x1...p2; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "too many decimal points" "bad hex float" { target *-*-* } 10 } */
......@@ -29,7 +29,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#undef FFS /* Some systems define this in param.h. */
#include "system.h"
#include <signal.h>
#include <setjmp.h>
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
......@@ -109,9 +108,7 @@ static void finalize PARAMS ((void));
static void set_target_switch PARAMS ((const char *));
static void float_signal PARAMS ((int)) ATTRIBUTE_NORETURN;
static void crash_signal PARAMS ((int)) ATTRIBUTE_NORETURN;
static void set_float_handler PARAMS ((jmp_buf));
static void compile_file PARAMS ((void));
static void display_help PARAMS ((void));
static void display_target_options PARAMS ((void));
......@@ -1626,73 +1623,6 @@ floor_log2_wide (x)
return log;
}
static int float_handler_set;
int float_handled;
jmp_buf float_handler;
/* Signals actually come here. */
static void
float_signal (signo)
/* If this is missing, some compilers complain. */
int signo ATTRIBUTE_UNUSED;
{
if (float_handled == 0)
crash_signal (signo);
float_handled = 0;
/* On System-V derived systems, we must reinstall the signal handler.
This is harmless on BSD-derived systems. */
signal (SIGFPE, float_signal);
longjmp (float_handler, 1);
}
/* Specify where to longjmp to when a floating arithmetic error happens.
If HANDLER is 0, it means don't handle the errors any more. */
static void
set_float_handler (handler)
jmp_buf handler;
{
float_handled = (handler != 0);
if (handler)
memcpy (float_handler, handler, sizeof (float_handler));
if (float_handled && ! float_handler_set)
{
signal (SIGFPE, float_signal);
float_handler_set = 1;
}
}
/* This is a wrapper function for code which might elicit an
arithmetic exception. That code should be passed in as a function
pointer FN, and one argument DATA. DATA is usually a struct which
contains the real input and output for function FN. This function
returns 0 (failure) if longjmp was called (i.e. an exception
occurred.) It returns 1 (success) otherwise. */
int
do_float_handler (fn, data)
void (*fn) PARAMS ((PTR));
PTR data;
{
jmp_buf buf;
if (setjmp (buf))
{
/* We got here via longjmp () caused by an exception in function
fn (). */
set_float_handler (NULL);
return 0;
}
set_float_handler (buf);
(*fn)(data);
set_float_handler (NULL);
return 1;
}
/* Handler for fatal signals, such as SIGSEGV. These are transformed
into ICE messages, which is much more user friendly. */
......@@ -4565,10 +4495,6 @@ general_init (argv0)
gcc_init_libintl ();
/* Install handler for SIGFPE, which may be received while we do
compile-time floating point arithmetic. */
signal (SIGFPE, float_signal);
/* Trap fatal signals, e.g. SIGSEGV, and convert them to ICE messages. */
#ifdef SIGSEGV
signal (SIGSEGV, crash_signal);
......@@ -4585,6 +4511,9 @@ general_init (argv0)
#if defined SIGIOT && (!defined SIGABRT || SIGABRT != SIGIOT)
signal (SIGIOT, crash_signal);
#endif
#ifdef SIGFPE
signal (SIGFPE, crash_signal);
#endif
/* Initialize the diagnostics reporting machinery, so option parsing
can give warnings and errors. */
......
......@@ -88,7 +88,6 @@ extern void error_for_asm PARAMS ((struct rtx_def *,
extern void warning_for_asm PARAMS ((struct rtx_def *,
const char *, ...));
extern void warn_deprecated_use PARAMS ((union tree_node *));
extern int do_float_handler PARAMS ((void (*) (PTR), PTR));
#ifdef BUFSIZ
extern void output_quoted_string PARAMS ((FILE *, const char *));
......
......@@ -122,7 +122,6 @@ struct type_hash
htab_t type_hash_table;
static void build_real_from_int_cst_1 PARAMS ((PTR));
static void set_type_quals PARAMS ((tree, int));
static void append_random_chars PARAMS ((char *));
static int type_hash_eq PARAMS ((const void*, const void*));
......@@ -591,31 +590,8 @@ real_value_from_int_cst (type, i)
return d;
}
/* Args to pass to and from build_real_from_int_cst_1. */
struct brfic_args
{
tree type; /* Input: type to conver to. */
tree i; /* Input: operand to convert. */
REAL_VALUE_TYPE d; /* Output: floating point value. */
};
/* Convert an integer to a floating point value while protected by a floating
point exception handler. */
static void
build_real_from_int_cst_1 (data)
PTR data;
{
struct brfic_args *args = (struct brfic_args *) data;
args->d = real_value_from_int_cst (args->type, args->i);
}
/* Given a tree representing an integer constant I, return a tree
representing the same value as a floating-point constant of type TYPE.
We cannot perform this operation if there is no way of doing arithmetic
on floating-point values. */
representing the same value as a floating-point constant of type TYPE. */
tree
build_real_from_int_cst (type, i)
......@@ -625,27 +601,13 @@ build_real_from_int_cst (type, i)
tree v;
int overflow = TREE_OVERFLOW (i);
REAL_VALUE_TYPE d;
struct brfic_args args;
v = make_node (REAL_CST);
TREE_TYPE (v) = type;
/* Setup input for build_real_from_int_cst_1() */
args.type = type;
args.i = i;
if (do_float_handler (build_real_from_int_cst_1, (PTR) &args))
/* Receive output from build_real_from_int_cst_1() */
d = args.d;
else
{
/* We got an exception from build_real_from_int_cst_1() */
d = dconst0;
overflow = 1;
}
d = real_value_from_int_cst (type, i);
/* Check for valid float value for this type on this target machine. */
#ifdef CHECK_FLOAT_VALUE
CHECK_FLOAT_VALUE (TYPE_MODE (type), d, overflow);
#endif
......
......@@ -33,8 +33,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define HAVE_DECL_GETOPT 1
#endif
/* GCC supplies this header. */
/* GCC supplies these headers. */
#include <stddef.h>
#include <float.h>
#ifdef inhibit_libc
......
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