diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-12-26 21:52:06 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-12-26 21:52:06 -0500 |
commit | a377ff85d0572f5fa1bbb87351e27f54684c456b (patch) | |
tree | 99f68c4430e459268ac168076f43fda45f200ee6 /gcc/fold-const.c | |
parent | 36c336d189804fe8fcb2980e8e52c4d0ca3ae39f (diff) | |
download | gcc-a377ff85d0572f5fa1bbb87351e27f54684c456b.zip gcc-a377ff85d0572f5fa1bbb87351e27f54684c456b.tar.gz gcc-a377ff85d0572f5fa1bbb87351e27f54684c456b.tar.bz2 |
(fold_convert): When converting a NaN to another type, change the type
of the node before returning it.
From-SVN: r10863
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index ba459c0..14e11d0 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -1481,7 +1481,11 @@ fold_convert (t, arg1) if (TREE_CODE (arg1) == REAL_CST) { if (REAL_VALUE_ISNAN (TREE_REAL_CST (arg1))) - return arg1; + { + t = arg1; + TREE_TYPE (arg1) = type; + return t; + } else if (setjmp (float_error)) { overflow = 1; |