aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorStephen L Moshier <moshier@world.std.com>1998-09-09 16:33:06 -0600
committerJeff Law <law@gcc.gnu.org>1998-09-09 16:33:06 -0600
commit7e3e369cdfd8ae1811cb4780c69453c3bc62fb58 (patch)
tree7296625fefa2578e5937d864be4e3a3207a9ccde /gcc
parent520c987d6a324cc51d09e3cda47afbf7f51a5ee6 (diff)
downloadgcc-7e3e369cdfd8ae1811cb4780c69453c3bc62fb58.zip
gcc-7e3e369cdfd8ae1811cb4780c69453c3bc62fb58.tar.gz
gcc-7e3e369cdfd8ae1811cb4780c69453c3bc62fb58.tar.bz2
emit-rtl.c (gen_lowpart_common): Disable optimization of initialized float-int union if the value is a NaN.
* emit-rtl.c (gen_lowpart_common): Disable optimization of initialized float-int union if the value is a NaN. From-SVN: r22371
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/emit-rtl.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 79c7c84..9dcc189 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 9 23:31:36 1998 (Stephen L Moshier) <moshier@world.std.com>
+
+ * emit-rtl.c (gen_lowpart_common): Disable optimization of
+ initialized float-int union if the value is a NaN.
+
Wed Sep 9 23:00:48 1998 Nathan Sidwell <nathan@acm.org>
* c-lex.c (real_yylex): Don't warn about long long constants if
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index d5ed392..a59437b 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -774,6 +774,9 @@ gen_lowpart_common (mode, x)
i = INTVAL (x);
r = REAL_VALUE_FROM_TARGET_SINGLE (i);
+ /* Avoid changing the bit pattern of a NaN. */
+ if (REAL_VALUE_ISNAN (r))
+ return 0;
return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
}
#else
@@ -812,6 +815,8 @@ gen_lowpart_common (mode, x)
i[0] = low, i[1] = high;
r = REAL_VALUE_FROM_TARGET_DOUBLE (i);
+ if (REAL_VALUE_ISNAN (r))
+ return 0;
return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
}
#else