emit-rtl.c (gen_lowpart_common): Disable optimization of initialized float-int union...
authorStephen L Moshier <moshier@world.std.com>
Wed, 9 Sep 1998 22:33:06 +0000 (16:33 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 9 Sep 1998 22:33:06 +0000 (16:33 -0600)
        * emit-rtl.c (gen_lowpart_common): Disable optimization of
        initialized float-int union if the value is a NaN.

From-SVN: r22371

gcc/ChangeLog
gcc/emit-rtl.c

index 79c7c842378291859731f162ad8917cb8b921d25..9dcc189acbb30e9eb170275cc96cb6f11056142d 100644 (file)
@@ -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 
index d5ed39205ebdaa4de626bb18b20ac44c41080719..a59437b41031f04ba62c2fca6bd216ffbbc95952 100644 (file)
@@ -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