aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/convex/convex.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-03-13 08:34:34 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-03-13 08:34:34 -0500
commit2e15b172de724f57679d6cf2acba6b366bc4c7dd (patch)
tree05c3b0be279a8809c40e15d47e4422915783d3f9 /gcc/config/convex/convex.c
parentc05f751c24182e733cb986b7660ec1223be52428 (diff)
downloadgcc-2e15b172de724f57679d6cf2acba6b366bc4c7dd.zip
gcc-2e15b172de724f57679d6cf2acba6b366bc4c7dd.tar.gz
gcc-2e15b172de724f57679d6cf2acba6b366bc4c7dd.tar.bz2
Add OVERFLOW operand to CHECK_FLOAT_VALUE.
From-SVN: r6770
Diffstat (limited to 'gcc/config/convex/convex.c')
-rw-r--r--gcc/config/convex/convex.c21
1 files changed, 15 insertions, 6 deletions
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.