Delete a copy that looks like a relic from obstack times.
authorBernd Schmidt <bernds@codesourcery.com>
Mon, 2 Jun 2014 12:06:11 +0000 (12:06 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Mon, 2 Jun 2014 12:06:11 +0000 (12:06 +0000)
* varasm.c (copy_constant): Delete function.
(build_constant_desc): Don't call it.

From-SVN: r211130

gcc/ChangeLog
gcc/varasm.c

index 2efa59fedf11de2fd5b2651a22ce59a6a63836a1..07f3b0fc65a1df307e0a1428421f7a228334a47d 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-02  Bernd Schmidt  <bernds@codesourcery.com>
+
+       * varasm.c (copy_constant): Delete function.
+       (build_constant_desc): Don't call it.
+
 2014-06-02  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
 
        PR target/61154
index 7755717fe2792e5f91c461a734e941a37f723213..375838ad9f5bcb15fd49ecf419105e339288ca53 100644 (file)
@@ -114,7 +114,6 @@ static hashval_t const_desc_hash (const void *);
 static int const_desc_eq (const void *, const void *);
 static hashval_t const_hash_1 (const tree);
 static int compare_constant (const tree, const tree);
-static tree copy_constant (tree);
 static void output_constant_def_contents (rtx);
 static void output_addressed_constants (tree);
 static unsigned HOST_WIDE_INT output_constant (tree, unsigned HOST_WIDE_INT,
@@ -3103,71 +3102,6 @@ compare_constant (const tree t1, const tree t2)
   gcc_unreachable ();
 }
 \f
-/* Make a copy of the whole tree structure for a constant.  This
-   handles the same types of nodes that compare_constant handles.  */
-
-static tree
-copy_constant (tree exp)
-{
-  switch (TREE_CODE (exp))
-    {
-    case ADDR_EXPR:
-      /* For ADDR_EXPR, we do not want to copy the decl whose address
-        is requested.  We do want to copy constants though.  */
-      if (CONSTANT_CLASS_P (TREE_OPERAND (exp, 0)))
-       return build1 (TREE_CODE (exp), TREE_TYPE (exp),
-                      copy_constant (TREE_OPERAND (exp, 0)));
-      else
-       return copy_node (exp);
-
-    case INTEGER_CST:
-    case REAL_CST:
-    case FIXED_CST:
-    case STRING_CST:
-      return copy_node (exp);
-
-    case COMPLEX_CST:
-      return build_complex (TREE_TYPE (exp),
-                           copy_constant (TREE_REALPART (exp)),
-                           copy_constant (TREE_IMAGPART (exp)));
-
-    case PLUS_EXPR:
-    case POINTER_PLUS_EXPR:
-    case MINUS_EXPR:
-      return build2 (TREE_CODE (exp), TREE_TYPE (exp),
-                    copy_constant (TREE_OPERAND (exp, 0)),
-                    copy_constant (TREE_OPERAND (exp, 1)));
-
-    CASE_CONVERT:
-    case VIEW_CONVERT_EXPR:
-      return build1 (TREE_CODE (exp), TREE_TYPE (exp),
-                    copy_constant (TREE_OPERAND (exp, 0)));
-
-    case VECTOR_CST:
-      return build_vector (TREE_TYPE (exp), VECTOR_CST_ELTS (exp));
-
-    case CONSTRUCTOR:
-      {
-       tree copy = copy_node (exp);
-       vec<constructor_elt, va_gc> *v;
-       unsigned HOST_WIDE_INT idx;
-       tree purpose, value;
-
-       vec_alloc (v, vec_safe_length (CONSTRUCTOR_ELTS (exp)));
-       FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (exp), idx, purpose, value)
-         {
-           constructor_elt ce = {purpose, copy_constant (value)};
-           v->quick_push (ce);
-         }
-       CONSTRUCTOR_ELTS (copy) = v;
-       return copy;
-      }
-
-    default:
-      gcc_unreachable ();
-    }
-}
-\f
 /* Return the section into which constant EXP should be placed.  */
 
 static section *
@@ -3208,7 +3142,7 @@ build_constant_desc (tree exp)
   tree decl;
 
   desc = ggc_alloc<constant_descriptor_tree> ();
-  desc->value = copy_constant (exp);
+  desc->value = exp;
 
   /* Create a string containing the label name, in LABEL.  */
   labelno = const_labelno++;