diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-13 06:41:07 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-13 06:41:07 +0000 |
commit | 4ee9c6840ad3fc92a9034343278a1e476ad6872a (patch) | |
tree | a2568888a519c077427b133de9ece5879a8484a5 /gcc/varasm.c | |
parent | ebb338380ab170c91e64d38038e6b5ce930d69a1 (diff) | |
download | gcc-4ee9c6840ad3fc92a9034343278a1e476ad6872a.tar.gz |
Merge tree-ssa-20020619-branch into mainline.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81764 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 13f1191a308..4b59129b0f6 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -48,6 +48,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm_p.h" #include "debug.h" #include "target.h" +#include "tree-mudflap.h" #include "cgraph.h" #include "cfglayout.h" @@ -56,10 +57,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA declarations for e.g. AIX 4.x. */ #endif -#ifndef TRAMPOLINE_ALIGNMENT -#define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY -#endif - #ifndef ASM_STABS_OP #define ASM_STABS_OP "\t.stabs\t" #endif @@ -782,6 +779,11 @@ make_decl_rtl (tree decl, const char *asmspec) This is necessary, for example, when one machine specific decl attribute overrides another. */ targetm.encode_section_info (decl, DECL_RTL (decl), false); + + /* Make this function static known to the mudflap runtime. */ + if (flag_mudflap && TREE_CODE (decl) == VAR_DECL) + mudflap_enqueue_decl (decl); + return; } @@ -882,6 +884,10 @@ make_decl_rtl (tree decl, const char *asmspec) If the name is changed, the macro ASM_OUTPUT_LABELREF will have to know how to strip this information. */ targetm.encode_section_info (decl, DECL_RTL (decl), true); + + /* Make this function static known to the mudflap runtime. */ + if (flag_mudflap && TREE_CODE (decl) == VAR_DECL) + mudflap_enqueue_decl (decl); } /* Make the rtl for variable VAR be volatile. @@ -1774,6 +1780,8 @@ assemble_static_space (unsigned HOST_WIDE_INT size) This is done at most once per compilation. Returns an RTX for the address of the template. */ +static GTY(()) rtx initial_trampoline; + #ifdef TRAMPOLINE_TEMPLATE rtx assemble_trampoline_template (void) @@ -1783,6 +1791,9 @@ assemble_trampoline_template (void) int align; rtx symbol; + if (initial_trampoline) + return initial_trampoline; + /* By default, put trampoline templates in read-only data section. */ #ifdef TRAMPOLINE_SECTION @@ -1807,7 +1818,10 @@ assemble_trampoline_template (void) symbol = gen_rtx_SYMBOL_REF (Pmode, name); SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL; - return symbol; + initial_trampoline = gen_rtx_MEM (BLKmode, symbol); + set_mem_align (initial_trampoline, TRAMPOLINE_ALIGNMENT); + + return initial_trampoline; } #endif @@ -2408,6 +2422,10 @@ build_constant_desc (tree exp) desc = ggc_alloc (sizeof (*desc)); desc->value = copy_constant (exp); + /* Propagate marked-ness to copied constant. */ + if (flag_mudflap && mf_marked_p (exp)) + mf_mark (desc->value); + /* Create a string containing the label name, in LABEL. */ labelno = const_labelno++; ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno); @@ -2553,15 +2571,8 @@ output_constant_def_contents (rtx symbol) /* Output the value of EXP. */ output_constant (exp, size, align); -} - -/* A constant which was deferred in its original location has been - inserted by the RTL inliner into a different function. The - current function's deferred constant count must be incremented. */ -void -notice_rtl_inlining_of_deferred_constant (void) -{ - n_deferred_constants++; + if (flag_mudflap) + mudflap_enqueue_constant (exp); } /* Look up EXP in the table of constant descriptors. Return the rtl @@ -4595,7 +4606,12 @@ categorize_decl_for_section (tree decl, int reloc, int shlib) if (TREE_CODE (decl) == FUNCTION_DECL) return SECCAT_TEXT; else if (TREE_CODE (decl) == STRING_CST) - return SECCAT_RODATA_MERGE_STR; + { + if (flag_mudflap) /* or !flag_merge_constants */ + return SECCAT_RODATA; + else + return SECCAT_RODATA_MERGE_STR; + } else if (TREE_CODE (decl) == VAR_DECL) { if (DECL_INITIAL (decl) == NULL @@ -5020,6 +5036,9 @@ default_file_start (void) which emits a special section directive used to indicate whether or not this object file needs an executable stack. This is primarily a GNU extension to ELF but could be used on other targets. */ + +int trampolines_created; + void file_end_indicate_exec_stack (void) { |