+/* Subroutine of output_constant_def:
+ No constant equal to EXP is known to have been output.
+ Make a constant descriptor to enter EXP in the hash table.
+ Assign the label number and construct RTL to refer to the
+ constant's location in memory.
+ Caller is responsible for updating the hash table. */
+
+static struct constant_descriptor_tree *
+build_constant_desc (tree exp)
+{
+ rtx symbol;
+ rtx rtl;
+ char label[256];
+ int labelno;
+ struct constant_descriptor_tree *desc;
+
+ desc = ggc_alloc (sizeof (*desc));
+ desc->value = copy_constant (exp);
+
+ /* Create a string containing the label name, in LABEL. */
+ labelno = const_labelno++;
+ ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno);
+
+ /* We have a symbol name; construct the SYMBOL_REF and the MEM. */
+ symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label));
+ SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL;
+ SYMBOL_REF_DECL (symbol) = desc->value;
+ TREE_CONSTANT_POOL_ADDRESS_P (symbol) = 1;
+
+ rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (exp)), symbol);
+ set_mem_attributes (rtl, exp, 1);
+ set_mem_alias_set (rtl, 0);
+ set_mem_alias_set (rtl, const_alias_set);
+
+ /* Set flags or add text to the name to record information, such as
+ that it is a local symbol. If the name is changed, the macro
+ ASM_OUTPUT_LABELREF will have to know how to strip this
+ information. This call might invalidate our local variable
+ SYMBOL; we can't use it afterward. */
+
+ (*targetm.encode_section_info) (exp, rtl, true);
+
+ desc->rtl = rtl;
+
+ return desc;
+}
+