From 2e15b172de724f57679d6cf2acba6b366bc4c7dd Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sun, 13 Mar 1994 08:34:34 -0500 Subject: Add OVERFLOW operand to CHECK_FLOAT_VALUE. From-SVN: r6770 --- gcc/config/convex/convex.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'gcc/config/convex/convex.c') diff --git a/gcc/config/convex/convex.c b/gcc/config/convex/convex.c index 2595e19..ce1b756 100644 --- a/gcc/config/convex/convex.c +++ b/gcc/config/convex/convex.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Convex. - Copyright (C) 1988, 1993 Free Software Foundation, Inc. + Copyright (C) 1988, 1993, 1994 Free Software Foundation, Inc. This file is part of GNU CC. @@ -413,31 +413,40 @@ expand_movstr_call (operands) #define MIN_FLOAT 2.9387358770557188e-39 #endif -void -check_float_value (mode, dp) +int +check_float_value (mode, dp, overflow) enum machine_mode mode; REAL_VALUE_TYPE *dp; + int overflow; { REAL_VALUE_TYPE d = *dp; + if (overflow) + { + *dp = MAX_FLOAT; + return 1; + } + if (mode == SFmode) { if (d > MAX_FLOAT) { - error ("magnitude of constant too large for `float'"); *dp = MAX_FLOAT; + return 1; } else if (d < -MAX_FLOAT) { - error ("magnitude of constant too large for `float'"); *dp = -MAX_FLOAT; + return 1; } else if ((d > 0 && d < MIN_FLOAT) || (d < 0 && d > -MIN_FLOAT)) { - warning ("`float' constant truncated to zero"); *dp = 0.0; + return 1; } } + + return 0; } /* Output the label at the start of a function. -- cgit v1.1