This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFC: Kill CONSTANT_AFTER_FUNCTION_P
- From: Zack Weinberg <zack at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 12 Apr 2003 21:04:26 -0700
- Subject: RFC: Kill CONSTANT_AFTER_FUNCTION_P
There is exactly one definition of CONSTANT_AFTER_FUNCTION_P in the
entire source tree: in config/mips/mips.h. It is surrounded by #if 0,
and has been so since 1998 -- possibly earlier; it showed up in a
merge, complete with #if 0. I propose to remove it entirely. Any
objection?
zw
* varasm.c (output_constant_def): Do not consult
CONSTANT_AFTER_FUNCTION_P. Remove all code predicated on it.
(after_function_constants, output_after_function_constants): Delete.
* doc/tm.texi: Delete documentation of CONSTANT_AFTER_FUNCTION_P.
* config/mips/mips-protos.h, config/mips/mips.c
(mips16_constant_after_function_p): Delete.
* config/mips/mips.h: Delete #if-0-ed definition of
CONSTANT_AFTER_FUNCTION_P.
* config/d30v/d30v.h, config/stormy16/stormy16.h: Remove
mention of CONSTANT_AFTER_FUNCTION_P in comment.
===================================================================
Index: varasm.c
--- varasm.c 11 Apr 2003 21:15:36 -0000 1.338
+++ varasm.c 13 Apr 2003 03:59:31 -0000
@@ -155,7 +155,6 @@ static void mark_constant_pool PARAMS (
static void mark_constants PARAMS ((rtx));
static int mark_constant PARAMS ((rtx *current_rtx, void *data));
static int output_addressed_constants PARAMS ((tree));
-static void output_after_function_constants PARAMS ((void));
static unsigned HOST_WIDE_INT array_size_for_constructor PARAMS ((tree));
static unsigned min_align PARAMS ((unsigned, unsigned));
static void output_constructor PARAMS ((tree, HOST_WIDE_INT,
@@ -1199,9 +1198,6 @@ assemble_end_function (decl, fnname)
output_constant_pool (fnname, decl);
function_section (decl); /* need to switch back */
}
-
- /* Output any constants which should appear after the function. */
- output_after_function_constants ();
}
/* Assemble code to leave SIZE bytes of zeros. */
@@ -2482,10 +2478,6 @@ struct deferred_constant
static struct deferred_constant *deferred_constants;
-/* Another list of constants which should be output after the
- function. */
-static struct deferred_constant *after_function_constants;
-
/* Nonzero means defer output of addressed subconstants
(i.e., those for which output_constant_def is called.) */
static int defer_addressed_constants_flag;
@@ -2521,23 +2513,6 @@ output_deferred_addressed_constants ()
deferred_constants = 0;
}
-/* Output any constants which should appear after a function. */
-
-static void
-output_after_function_constants ()
-{
- struct deferred_constant *p, *next;
-
- for (p = after_function_constants; p; p = next)
- {
- output_constant_def_contents (p->exp, p->reloc, p->labelno);
- next = p->next;
- free (p);
- }
-
- after_function_constants = 0;
-}
-
/* Make a copy of the whole tree structure for a constant. This
handles the same types of nodes that compare_constant handles. */
@@ -2631,7 +2606,6 @@ output_constant_def (exp, defer)
char label[256];
int reloc;
int found = 1;
- int after_function = 0;
int labelno = -1;
rtx rtl;
@@ -2709,15 +2683,9 @@ output_constant_def (exp, defer)
desc->label = XSTR (XEXP (desc->rtl, 0), 0);
}
-#ifdef CONSTANT_AFTER_FUNCTION_P
- if (current_function_decl != 0
- && CONSTANT_AFTER_FUNCTION_P (exp))
- after_function = 1;
-#endif
-
if (found
&& STRING_POOL_ADDRESS_P (XEXP (rtl, 0))
- && (!defer || defer_addressed_constants_flag || after_function))
+ && (!defer || defer_addressed_constants_flag))
{
defstr = (struct deferred_string **)
htab_find_slot_with_hash (const_str_htab, desc->label,
@@ -2737,7 +2705,7 @@ output_constant_def (exp, defer)
output it (or defer its output for later). */
if (! found)
{
- if (defer_addressed_constants_flag || after_function)
+ if (defer_addressed_constants_flag)
{
struct deferred_constant *p
= (struct deferred_constant *)
@@ -2746,16 +2714,8 @@ output_constant_def (exp, defer)
p->exp = desc->value;
p->reloc = reloc;
p->labelno = labelno;
- if (after_function)
- {
- p->next = after_function_constants;
- after_function_constants = p;
- }
- else
- {
- p->next = deferred_constants;
- deferred_constants = p;
- }
+ p->next = deferred_constants;
+ deferred_constants = p;
}
else
{
===================================================================
Index: config/d30v/d30v.h
--- config/d30v/d30v.h 19 Feb 2003 18:03:09 -0000 1.78
+++ config/d30v/d30v.h 13 Apr 2003 03:59:34 -0000
@@ -2738,12 +2738,6 @@ extern const char *d30v_branch_cost_stri
You need not define this macro if it would do nothing. */
/* #define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, JUMPTO) */
-/* Define this macro as a C expression which is nonzero if the constant EXP, of
- type `tree', should be output after the code for a function. The compiler
- will normally output all constants before the function; you need not define
- this macro if this is OK. */
-/* #define CONSTANT_AFTER_FUNCTION_P(EXP) */
-
/* A C statement to output assembler commands to at the end of the constant
pool for a function. FUNNAME is a string giving the name of the function.
Should the return type of the function be required, you can obtain it via
===================================================================
Index: config/mips/mips-protos.h
--- config/mips/mips-protos.h 31 Jan 2003 23:34:15 -0000 1.33
+++ config/mips/mips-protos.h 13 Apr 2003 03:59:34 -0000
@@ -74,7 +74,6 @@ extern int mips_setup_incoming_varargs
extern int function_arg_pass_by_reference
PARAMS ((const CUMULATIVE_ARGS *,
enum machine_mode, tree, int));
-extern int mips16_constant_after_function_p PARAMS ((tree));
extern int mips_output_external PARAMS ((FILE *, tree,
const char *));
extern tree mips_build_va_list PARAMS ((void));
===================================================================
Index: config/mips/mips.c
--- config/mips/mips.c 1 Apr 2003 21:45:28 -0000 1.254
+++ config/mips/mips.c 13 Apr 2003 03:59:37 -0000
@@ -9128,46 +9128,6 @@ mips16_output_gp_offset (file, x)
output_addr_const (file, x);
}
-/* Return nonzero if a constant should not be output until after the
- function. This is true of most string constants, so that we can
- use a more efficient PC relative reference. However, a static
- inline function may never call assemble_function_end to write out
- the constant pool, so don't try to postpone the constant in that
- case.
-
- ??? It's really a bug that a static inline function can put stuff
- in the constant pool even if the function itself is not output.
-
- We record which string constants we've seen, so that we know which
- ones might use the more efficient reference. */
-
-int
-mips16_constant_after_function_p (x)
- tree x;
-{
- if (TREE_CODE (x) == STRING_CST
- && ! flag_writable_strings
- && current_function_decl != 0
- && ! DECL_DEFER_OUTPUT (current_function_decl)
- && ! (DECL_INLINE (current_function_decl)
- && ((! TREE_PUBLIC (current_function_decl)
- && ! TREE_ADDRESSABLE (current_function_decl)
- && ! flag_keep_inline_functions)
- || DECL_EXTERNAL (current_function_decl))))
- {
- struct string_constant *n;
-
- n = (struct string_constant *) xmalloc (sizeof *n);
- n->label = XSTR (XEXP (TREE_CST_RTL (x), 0), 0);
- n->next = string_constants;
- string_constants = n;
-
- return 1;
- }
-
- return 0;
-}
-
/* Validate a constant for the mips16. This rejects general symbolic
addresses, which must be loaded from memory. If ADDR is nonzero,
this should reject anything which is not a legal address. If
===================================================================
Index: config/mips/mips.h
--- config/mips/mips.h 1 Apr 2003 19:43:29 -0000 1.242
+++ config/mips/mips.h 13 Apr 2003 03:59:39 -0000
@@ -3312,11 +3312,6 @@ typedef struct mips_args {
#define ASM_OUTPUT_POOL_EPILOGUE(FILE, FNNAME, FNDECL, SIZE) \
mips_string_length = 0;
-#if 0
-/* In mips16 mode, put most string constants after the function. */
-#define CONSTANT_AFTER_FUNCTION_P(tree) \
- (TARGET_MIPS16 && mips16_constant_after_function_p (tree))
-#endif
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction.
===================================================================
Index: config/stormy16/stormy16.h
--- config/stormy16/stormy16.h 9 Mar 2003 18:49:17 -0000 1.71
+++ config/stormy16/stormy16.h 13 Apr 2003 03:59:40 -0000
@@ -2538,12 +2538,6 @@ do { \
You need not define this macro if it would do nothing. */
/* #define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, JUMPTO) */
-/* Define this macro as a C expression which is nonzero if the constant EXP, of
- type `tree', should be output after the code for a function. The compiler
- will normally output all constants before the function; you need not define
- this macro if this is OK. */
-/* #define CONSTANT_AFTER_FUNCTION_P(EXP) */
-
/* A C statement to output assembler commands to at the end of the constant
pool for a function. FUNNAME is a string giving the name of the function.
Should the return type of the function be required, you can obtain it via
===================================================================
Index: doc/tm.texi
--- doc/tm.texi 3 Apr 2003 18:23:04 -0000 1.209
+++ doc/tm.texi 13 Apr 2003 03:59:45 -0000
@@ -6386,13 +6386,6 @@ entry from being output a second time in
You need not define this macro if it would do nothing.
- at findex CONSTANT_AFTER_FUNCTION_P
- at item CONSTANT_AFTER_FUNCTION_P (@var{exp})
-Define this macro as a C expression which is nonzero if the constant
- at var{exp}, of type @code{tree}, should be output after the code for a
-function. The compiler will normally output all constants before the
-function; you need not define this macro if this is OK at dot
-
@findex ASM_OUTPUT_POOL_EPILOGUE
@item ASM_OUTPUT_POOL_EPILOGUE (@var{file} @var{funname} @var{fundecl} @var{size})
A C statement to output assembler commands to at the end of the constant