OSDN Git Service

2008-12-12 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-call-cdce.c
index f59f083..301fe25 100644 (file)
@@ -99,8 +99,6 @@ typedef struct input_domain
   bool is_ub_inclusive;
 } inp_domain;
 
-static VEC (gimple, heap) *cond_dead_built_in_calls;
-
 /* A helper function to construct and return an input
    domain object.  LB is the lower bound, HAS_LB is 
    a boolean flag indicating if the lower bound exists,
@@ -143,9 +141,11 @@ check_target_format (tree arg)
   mode = TYPE_MODE (type);
   rfmt = REAL_MODE_FORMAT (mode);
   if ((mode == SFmode
-       && (rfmt == &ieee_single_format || rfmt == &mips_single_format))
+       && (rfmt == &ieee_single_format || rfmt == &mips_single_format
+          || rfmt == &motorola_single_format))
       || (mode == DFmode
-         && (rfmt == &ieee_double_format || rfmt == &mips_double_format))
+         && (rfmt == &ieee_double_format || rfmt == &mips_double_format
+             || rfmt == &motorola_double_format))
       /* For long double, we can not really check XFmode
          which is only defined on intel platforms.  
          Candidate pre-selection using builtin function 
@@ -154,6 +154,7 @@ check_target_format (tree arg)
       || (mode != SFmode && mode != DFmode 
           && (rfmt == &ieee_quad_format
              || rfmt == &mips_quad_format
+             || rfmt == &ieee_extended_motorola_format
               || rfmt == &ieee_extended_intel_96_format 
               || rfmt == &ieee_extended_intel_128_format 
               || rfmt == &ieee_extended_intel_96_round_53_format)))
@@ -844,18 +845,18 @@ shrink_wrap_one_built_in_call (gimple bi_call)
    wrapping transformation.  */
 
 static bool
-shrink_wrap_conditional_dead_built_in_calls (void)
+shrink_wrap_conditional_dead_built_in_calls (VEC (gimple, heap) *calls)
 {
   bool changed = false;
   unsigned i = 0;
 
-  unsigned n = VEC_length (gimple, cond_dead_built_in_calls);
+  unsigned n = VEC_length (gimple, calls);
   if (n == 0) 
     return false;
 
   for (; i < n ; i++)
     {
-      gimple bi_call = VEC_index (gimple, cond_dead_built_in_calls, i);
+      gimple bi_call = VEC_index (gimple, calls, i);
       changed |= shrink_wrap_one_built_in_call (bi_call);
     }
 
@@ -870,8 +871,7 @@ tree_call_cdce (void)
   basic_block bb;
   gimple_stmt_iterator i;
   bool something_changed = false;
-  cond_dead_built_in_calls = VEC_alloc (gimple, heap, 64);
-
+  VEC (gimple, heap) *cond_dead_built_in_calls = NULL;
   FOR_EACH_BB (bb)
     {
       /* Collect dead call candidates.  */
@@ -887,12 +887,18 @@ tree_call_cdce (void)
                   print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
                   fprintf (dump_file, "\n");
                 }
-              VEC_quick_push (gimple, cond_dead_built_in_calls, stmt);
+             if (cond_dead_built_in_calls == NULL)
+               cond_dead_built_in_calls = VEC_alloc (gimple, heap, 64);
+             VEC_safe_push (gimple, heap, cond_dead_built_in_calls, stmt);
             }
        }
     }
 
-  something_changed = shrink_wrap_conditional_dead_built_in_calls ();
+  if (cond_dead_built_in_calls == NULL)
+    return 0;
+
+  something_changed
+    = shrink_wrap_conditional_dead_built_in_calls (cond_dead_built_in_calls);
 
   VEC_free (gimple, heap, cond_dead_built_in_calls);