OSDN Git Service

* varasm.c (immed_real_const_1): Don't elide special cases for
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 29 Jul 2001 02:46:18 +0000 (02:46 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 29 Jul 2001 02:46:18 +0000 (02:46 +0000)
        nested functions.
        (clear_const_double_mem): Clear const_tiny_rtx too.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44445 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/varasm.c

index ef77e9e..c47536a 100644 (file)
@@ -1,5 +1,11 @@
 2001-07-28  Richard Henderson  <rth@redhat.com>
 
+       * varasm.c (immed_real_const_1): Don't elide special cases for
+       nested functions.
+       (clear_const_double_mem): Clear const_tiny_rtx too.
+
+2001-07-28  Richard Henderson  <rth@redhat.com>
+
        * dwarf2out.c (dw_val_class_offset): New.
        (struct dw_ranges_struct, dw_ranges_ref): New.
        (ranges_table, ranges_table_allocated): New.
index e739784..4b9438e 100644 (file)
@@ -1917,19 +1917,15 @@ immed_real_const_1 (d, mode)
 
   u.d = d;
 
-  /* Detect special cases.  But be careful we don't use a CONST_DOUBLE
-     that's from a parent function since it may be in its constant pool.  */
-  if (REAL_VALUES_IDENTICAL (dconst0, d)
-      && (cfun == 0 || decl_function_context (current_function_decl) == 0))
+  /* Detect special cases.  */
+  if (REAL_VALUES_IDENTICAL (dconst0, d))
     return CONST0_RTX (mode);
 
   /* Check for NaN first, because some ports (specifically the i386) do not
      emit correct ieee-fp code by default, and thus will generate a core
      dump here if we pass a NaN to REAL_VALUES_EQUAL and if REAL_VALUES_EQUAL
      does a floating point comparison.  */
-  else if ((! REAL_VALUE_ISNAN (d) && REAL_VALUES_EQUAL (dconst1, d))
-          && (cfun == 0
-              || decl_function_context (current_function_decl) == 0))
+  else if (! REAL_VALUE_ISNAN (d) && REAL_VALUES_EQUAL (dconst1, d))
     return CONST1_RTX (mode);
 
   if (sizeof u == sizeof (HOST_WIDE_INT))
@@ -1996,6 +1992,8 @@ void
 clear_const_double_mem ()
 {
   register rtx r, next;
+  enum machine_mode mode;
+  int i;
 
   for (r = const_double_chain; r; r = next)
     {
@@ -2004,6 +2002,15 @@ clear_const_double_mem ()
       CONST_DOUBLE_MEM (r) = cc0_rtx;
     }
   const_double_chain = 0;
+
+  for (i = 0; i <= 2; i++)
+    for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode;
+         mode = GET_MODE_WIDER_MODE (mode))
+      {
+       r = const_tiny_rtx[i][(int) mode];
+       CONST_DOUBLE_CHAIN (r) = 0;
+       CONST_DOUBLE_MEM (r) = cc0_rtx;
+      }
 }
 \f
 /* Given an expression EXP with a constant value,