#endif /* BSS_SECTION_ASM_OP */
static void mark_weak (tree);
static void output_constant_pool (const char *, tree);
-static rtx output_constant_def_1 (tree, tree, int);
\f
/* Well-known sections, each one associated with some sort of *_ASM_OP. */
section *text_section;
pre-computed RTL or recompute it in LTO mode. */
if (TREE_CODE (decl) == VAR_DECL && DECL_IN_CONSTANT_POOL (decl))
{
- SET_DECL_RTL (decl, output_constant_def_1 (DECL_INITIAL (decl),
- decl, 1));
+ SET_DECL_RTL (decl, output_constant_def (DECL_INITIAL (decl), 1));
return;
}
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.
- If DECL is non-NULL use it as VAR_DECL associated with the constant.
Caller is responsible for updating the hash table. */
static struct constant_descriptor_tree *
-build_constant_desc (tree exp, tree decl)
+build_constant_desc (tree exp)
{
struct constant_descriptor_tree *desc;
rtx symbol, rtl;
char label[256];
int labelno;
+ tree decl;
desc = ggc_alloc_constant_descriptor_tree ();
desc->value = copy_constant (exp);
ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno);
/* Construct the VAR_DECL associated with the constant. */
- if (decl == NULL_TREE)
- {
- decl = build_decl (UNKNOWN_LOCATION, VAR_DECL, get_identifier (label),
- TREE_TYPE (exp));
- DECL_ARTIFICIAL (decl) = 1;
- DECL_IGNORED_P (decl) = 1;
- TREE_READONLY (decl) = 1;
- TREE_STATIC (decl) = 1;
- TREE_ADDRESSABLE (decl) = 1;
- /* We don't set the RTL yet as this would cause varpool to assume that
- the variable is referenced. Moreover, it would just be dropped in
- LTO mode. Instead we set the flag that will be recognized in
- make_decl_rtl. */
- DECL_IN_CONSTANT_POOL (decl) = 1;
- DECL_INITIAL (decl) = desc->value;
- /* ??? CONSTANT_ALIGNMENT hasn't been updated for vector types on most
- architectures so use DATA_ALIGNMENT as well, except for strings. */
- if (TREE_CODE (exp) == STRING_CST)
- {
+ decl = build_decl (UNKNOWN_LOCATION, VAR_DECL, get_identifier (label),
+ TREE_TYPE (exp));
+ DECL_ARTIFICIAL (decl) = 1;
+ DECL_IGNORED_P (decl) = 1;
+ TREE_READONLY (decl) = 1;
+ TREE_STATIC (decl) = 1;
+ TREE_ADDRESSABLE (decl) = 1;
+ /* We don't set the RTL yet as this would cause varpool to assume that the
+ variable is referenced. Moreover, it would just be dropped in LTO mode.
+ Instead we set the flag that will be recognized in make_decl_rtl. */
+ DECL_IN_CONSTANT_POOL (decl) = 1;
+ DECL_INITIAL (decl) = desc->value;
+ /* ??? CONSTANT_ALIGNMENT hasn't been updated for vector types on most
+ architectures so use DATA_ALIGNMENT as well, except for strings. */
+ if (TREE_CODE (exp) == STRING_CST)
+ {
#ifdef CONSTANT_ALIGNMENT
- DECL_ALIGN (decl) = CONSTANT_ALIGNMENT (exp, DECL_ALIGN (decl));
+ DECL_ALIGN (decl) = CONSTANT_ALIGNMENT (exp, DECL_ALIGN (decl));
#endif
- }
- else
- align_variable (decl, 0);
}
+ else
+ align_variable (decl, 0);
/* Now construct the SYMBOL_REF and the MEM. */
if (use_object_blocks_p ())
}
/* Return an rtx representing a reference to constant data in memory
- for the constant expression EXP with the associated DECL.
+ for the constant expression EXP.
If assembler code for such a constant has already been output,
return an rtx to refer to it.
`const_desc_table' records which constants already have label strings. */
-static rtx
-output_constant_def_1 (tree exp, tree decl, int defer)
+rtx
+output_constant_def (tree exp, int defer)
{
struct constant_descriptor_tree *desc;
struct constant_descriptor_tree key;
desc = (struct constant_descriptor_tree *) *loc;
if (desc == 0)
{
- desc = build_constant_desc (exp, decl);
+ desc = build_constant_desc (exp);
desc->hash = key.hash;
*loc = desc;
}
return desc->rtl;
}
-/* Like output_constant_def but create a new decl representing the
- constant if necessary. */
-
-rtx
-output_constant_def (tree exp, int defer)
-{
- return output_constant_def_1 (exp, NULL_TREE, defer);
-}
-
/* Subroutine of output_constant_def: Decide whether or not we need to
output the constant DESC now, and if so, do it. */
static void
desc = (struct constant_descriptor_tree *) *loc;
if (desc == 0)
{
- desc = build_constant_desc (exp, NULL_TREE);
+ desc = build_constant_desc (exp);
desc->hash = key.hash;
*loc = desc;
}