rtl.h (TREE_CONSTANT_POOL_ADDRESS_P): Rename from DEFERRED_CONSTANT_P.

* rtl.h (TREE_CONSTANT_POOL_ADDRESS_P): Rename from
        DEFERRED_CONSTANT_P.
        * integrate.c (copy_rtx_and_substitute): Update use.
        * varasm.c (build_constant_desc): Set SYMBOL_REF_DECL
        to the copy generated.
        (maybe_output_constant_def_contents): Examine TREE_ASM_WRITTEN
        of the constant to see if we should emit.
        (mark_constant): Similarly.
        (output_constant_def_contents): Set TREE_ASM_WRITTEN.

From-SVN: r66807
This commit is contained in:
Richard Henderson 2003-05-14 10:44:01 -07:00 committed by Richard Henderson
parent bb84cb12fb
commit 2adb9af1f8
4 changed files with 38 additions and 21 deletions

View File

@ -1,3 +1,15 @@
2003-05-14 Richard Henderson <rth@redhat.com>
* rtl.h (TREE_CONSTANT_POOL_ADDRESS_P): Rename from
DEFERRED_CONSTANT_P.
* integrate.c (copy_rtx_and_substitute): Update use.
* varasm.c (build_constant_desc): Set SYMBOL_REF_DECL
to the copy generated.
(maybe_output_constant_def_contents): Examine TREE_ASM_WRITTEN
of the constant to see if we should emit.
(mark_constant): Similarly.
(output_constant_def_contents): Set TREE_ASM_WRITTEN.
2003-05-14 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.md (movsi_internal2): Use compare for self

View File

@ -2215,7 +2215,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
copy_rtx_and_substitute (constant, map, for_lhs)),
0);
}
else if (DEFERRED_CONSTANT_P (orig) && inlining)
else if (TREE_CONSTANT_POOL_ADDRESS_P (orig) && inlining)
notice_rtl_inlining_of_deferred_constant ();
return orig;

View File

@ -1230,15 +1230,16 @@ do { \
#define COND_EXEC_TEST(RTX) XCEXP (RTX, 0, COND_EXEC)
#define COND_EXEC_CODE(RTX) XCEXP (RTX, 1, COND_EXEC)
/* 1 if RTX is a symbol_ref that addresses this function's constants pool. */
/* 1 if RTX is a symbol_ref that addresses this function's rtl
constants pool. */
#define CONSTANT_POOL_ADDRESS_P(RTX) \
(RTL_FLAG_CHECK1("CONSTANT_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->unchanging)
/* 1 if RTX is a symbol_ref that addresses a value in the file's constant
pool which has not yet been output. This information is private to
varasm.c. */
#define DEFERRED_CONSTANT_P(RTX) \
(RTL_FLAG_CHECK1("DEFERRED_CONSTANT_P", (RTX), SYMBOL_REF)->frame_related)
/* 1 if RTX is a symbol_ref that addresses a value in the file's
tree constant pool. This information is private to varasm.c. */
#define TREE_CONSTANT_POOL_ADDRESS_P(RTX) \
(RTL_FLAG_CHECK1("TREE_CONSTANT_POOL_ADDRESS_P", \
(RTX), SYMBOL_REF)->frame_related)
/* Used if RTX is a symbol_ref, for machine-specific purposes. */
#define SYMBOL_REF_FLAG(RTX) \

View File

@ -2535,7 +2535,8 @@ build_constant_desc (exp)
/* 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) = exp;
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);
@ -2550,12 +2551,6 @@ build_constant_desc (exp)
(*targetm.encode_section_info) (exp, rtl, true);
/* Descriptors start out deferred; this simplifies the logic in
maybe_output_constant_def_contents. However, we do not bump
n_deferred_constants here, because we don't know if we're inside
a function and have an n_deferred_constants to bump. */
DEFERRED_CONSTANT_P (XEXP (rtl, 0)) = 1;
desc->rtl = rtl;
return desc;
@ -2607,19 +2602,24 @@ maybe_output_constant_def_contents (desc, defer)
int defer;
{
rtx symbol = XEXP (desc->rtl, 0);
tree exp = desc->value;
if (flag_syntax_only)
return;
if (!DEFERRED_CONSTANT_P (symbol))
if (TREE_ASM_WRITTEN (exp))
/* Already output; don't do it again. */
return;
/* The only constants that cannot safely be deferred, assuming the
context allows it, are strings under flag_writable_strings. */
if (defer && (TREE_CODE (desc->value) != STRING_CST
|| !flag_writable_strings))
if (defer && (TREE_CODE (exp) != STRING_CST || !flag_writable_strings))
{
/* Increment n_deferred_constants if it exists. It needs to be at
least as large as the number of constants actually referred to
by the function. If it's too small we'll stop looking too early
and fail to emit constants; if it's too large we'll only look
through the entire function when we could have stopped earlier. */
if (cfun)
n_deferred_constants++;
return;
@ -2648,7 +2648,7 @@ output_constant_def_contents (symbol)
#endif
/* We are no longer deferring this constant. */
DEFERRED_CONSTANT_P (symbol) = 0;
TREE_ASM_WRITTEN (exp) = 1;
if (IN_NAMED_SECTION (exp))
named_section (exp, NULL, reloc);
@ -3481,10 +3481,14 @@ mark_constant (current_rtx, data)
else
return -1;
}
else if (DEFERRED_CONSTANT_P (x))
else if (TREE_CONSTANT_POOL_ADDRESS_P (x))
{
n_deferred_constants--;
output_constant_def_contents (x);
tree exp = SYMBOL_REF_DECL (x);
if (!TREE_ASM_WRITTEN (exp))
{
n_deferred_constants--;
output_constant_def_contents (x);
}
}
}
return 0;