ipa-cp.c (ipcp_store_vr_results): Avoid static local var zero.
authorJakub Jelinek <jakub@redhat.com>
Fri, 23 Sep 2016 09:43:09 +0000 (11:43 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 23 Sep 2016 09:43:09 +0000 (11:43 +0200)
* ipa-cp.c (ipcp_store_vr_results): Avoid static local
var zero.
* sreal.h (sreal::min, sreal::max): Avoid static local vars,
construct values without normalization.
* tree-ssa-sccvn.c (vn_reference_lookup_3): Don't initialize
static local lhs_ops to vNULL.
cp/
* name-lookup.c (store_bindings, store_class_bindings): Don't
initialize static local bindings_need_stored to vNULL.

From-SVN: r240408

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/ipa-cp.c
gcc/sreal.h
gcc/tree-ssa-sccvn.c

index 561f612fba8e53d7b412148ad1dc936ba2f7376d..36795f41211401ba958bb2e192118ca07ef3197e 100644 (file)
@@ -1,3 +1,12 @@
+2016-09-23  Jakub Jelinek  <jakub@redhat.com>
+
+       * ipa-cp.c (ipcp_store_vr_results): Avoid static local
+       var zero.
+       * sreal.h (sreal::min, sreal::max): Avoid static local vars,
+       construct values without normalization.
+       * tree-ssa-sccvn.c (vn_reference_lookup_3): Don't initialize
+       static local lhs_ops to vNULL.
+
 2016-09-23  Matthew Wahab  <matthew.wahab@arm.com>
            Jiong Wang <jiong.wang@arm.com>
 
index ae5934301c9fc3b98d881aee49c7789ef3be0b45..9f5eba8500edd8cbe12e3f3c5a8fd9ace4e269fb 100644 (file)
@@ -1,5 +1,8 @@
 2016-09-23  Jakub Jelinek  <jakub@redhat.com>
 
+       * name-lookup.c (store_bindings, store_class_bindings): Don't
+       initialize static local bindings_need_stored to vNULL.
+
        * typeck2.c (process_init_constructor_record): Use
        CONSTRUCTOR_NELTS (...) instead of
        vec_safe_length (CONSTRUCTOR_ELTS (...)).
index 952d8b799ab93766ded5bc98d27866fd71aa4729..ce16d57b5d7f18b21a56a023dc6355d98ab4acf1 100644 (file)
@@ -6197,7 +6197,7 @@ store_binding (tree id, vec<cxx_saved_binding, va_gc> **old_bindings)
 static void
 store_bindings (tree names, vec<cxx_saved_binding, va_gc> **old_bindings)
 {
-  static vec<tree> bindings_need_stored = vNULL;
+  static vec<tree> bindings_need_stored;
   tree t, id;
   size_t i;
 
@@ -6233,7 +6233,7 @@ static void
 store_class_bindings (vec<cp_class_binding, va_gc> *names,
                      vec<cxx_saved_binding, va_gc> **old_bindings)
 {
-  static vec<tree> bindings_need_stored = vNULL;
+  static vec<tree> bindings_need_stored;
   size_t i;
   cp_class_binding *cb;
 
index cb60f1e36f6079391d213cd3d4cc4ac2504543d1..fdcce16f412eebe5f8dbcd4a3219f1604376e968 100644 (file)
@@ -5204,11 +5204,9 @@ ipcp_store_vr_results (void)
         }
        else
         {
-          static wide_int zero = integer_zero_node;
           vr.known = false;
           vr.type = VR_VARYING;
-          vr.min = zero;
-          vr.max = zero;
+          vr.min = vr.max = wi::zero (INT_TYPE_SIZE);
         }
        ts->m_vr->quick_push (vr);
      }
index edf02f14cfa9fd49ee80fd619346aa2f4ac9a26c..ce9cdbbfded8e938106c72f5d5c548356641cd99 100644 (file)
@@ -104,14 +104,20 @@ public:
   /* Global minimum sreal can hold.  */
   inline static sreal min ()
   {
-    static sreal min = sreal (-SREAL_MAX_SIG, SREAL_MAX_EXP);
+    sreal min;
+    /* This never needs normalization.  */
+    min.m_sig = -SREAL_MAX_SIG;
+    min.m_exp = SREAL_MAX_EXP;
     return min;
   }
 
   /* Global minimum sreal can hold.  */
   inline static sreal max ()
   {
-    static sreal max = sreal (SREAL_MAX_SIG, SREAL_MAX_EXP);
+    sreal max;
+    /* This never needs normalization.  */
+    max.m_sig = SREAL_MAX_SIG;
+    max.m_exp = SREAL_MAX_EXP;
     return max;
   }
 
index bf5e97ae2f03846a8b907f41a1531f3053dbd51b..21cc54e60b62573ca42c3f18662d1db126aebb6c 100644 (file)
@@ -1786,8 +1786,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_,
   gimple *def_stmt = SSA_NAME_DEF_STMT (vuse);
   tree base = ao_ref_base (ref);
   HOST_WIDE_INT offset, maxsize;
-  static vec<vn_reference_op_s>
-    lhs_ops = vNULL;
+  static vec<vn_reference_op_s> lhs_ops;
   ao_ref lhs_ref;
   bool lhs_ref_ok = false;