From ce7bcd9508e47a43047a4cd4052b338f80f77dc7 Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 23 Sep 2016 09:43:09 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240408 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 9 +++++++++ gcc/cp/ChangeLog | 3 +++ gcc/cp/name-lookup.c | 4 ++-- gcc/ipa-cp.c | 4 +--- gcc/sreal.h | 10 ++++++++-- gcc/tree-ssa-sccvn.c | 3 +-- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 561f612fba8..36795f41211 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2016-09-23 Jakub Jelinek + + * 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 Jiong Wang diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ae5934301c9..9f5eba8500e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2016-09-23 Jakub Jelinek + * 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 (...)). diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 952d8b799ab..ce16d57b5d7 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -6197,7 +6197,7 @@ store_binding (tree id, vec **old_bindings) static void store_bindings (tree names, vec **old_bindings) { - static vec bindings_need_stored = vNULL; + static vec bindings_need_stored; tree t, id; size_t i; @@ -6233,7 +6233,7 @@ static void store_class_bindings (vec *names, vec **old_bindings) { - static vec bindings_need_stored = vNULL; + static vec bindings_need_stored; size_t i; cp_class_binding *cb; diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index cb60f1e36f6..fdcce16f412 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -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); } diff --git a/gcc/sreal.h b/gcc/sreal.h index edf02f14cfa..ce9cdbbfded 100644 --- a/gcc/sreal.h +++ b/gcc/sreal.h @@ -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; } diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index bf5e97ae2f0..21cc54e60b6 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -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 - lhs_ops = vNULL; + static vec lhs_ops; ao_ref lhs_ref; bool lhs_ref_ok = false; -- 2.11.4.GIT