From f1d8a2d9bc3a817309c299147ff85e5091b6693e Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 27 Apr 2022 13:48:49 +0200 Subject: Embed real_value into REAL_CST The following removes the indirection to real_value from REAL_CST which doesn't seem to serve any useful purpose. Any sharing can be achieved by sharing the actual REAL_CST (which is what usually happens when copying trees) and sharing of real_value amongst different REAL_CST doesn't happen as far as I can see and would only lead to further issues like mismatching type and real_value. 2022-04-27 Richard Biener * tree-core.h (tree_real_cst::real_cst_ptr): Remove pointer to real_value field. (tree_real_cst::value): Add real_value field. * tree.h (TREE_REAL_CST_PTR): Adjust. * tree.cc (build_real): Remove separate allocation. * tree-streamer-in.cc (unpack_ts_real_cst_value_fields): Likewise. gcc/cp/ * module.cc (trees_in::core_vals): Remove separate allocation for REAL_CST. --- gcc/cp/module.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index cebf9c3..18dabfc 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -6468,9 +6468,7 @@ trees_in::core_vals (tree t) case REAL_CST: if (const void *bytes = buf (sizeof (real_value))) - TREE_REAL_CST_PTR (t) - = reinterpret_cast (memcpy (ggc_alloc (), - bytes, sizeof (real_value))); + memcpy (TREE_REAL_CST_PTR (t), bytes, sizeof (real_value)); break; case STRING_CST: -- cgit v1.1