diff options
author | Rong Xu <xur@google.com> | 2014-07-21 16:47:22 -0700 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2014-07-29 15:31:03 -0700 |
commit | 38a8aecfb882072900434499696b5c32a2274515 (patch) | |
tree | 2aac97f0ae24b03cd98c1a06e989c031c173f889 /gcc-4.9/gcc/varasm.c | |
parent | c231900e5dcc14d8296bd9f62b45997a49d4d5e7 (diff) | |
download | toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.tar.gz toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.tar.bz2 toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.zip |
[4.9] Switch gcc-4.9 to use google/gcc-4_9 branch.
This source drop uses svn version r212828 of google/gcc-4.9 branch.
We also cherry-picked r213062, r213063 and r213064 to fix windows
build issues.
All gcc-4.9 patches before July 3rd are ported to google/gcc-4.9.
The following prior commits has not been merged to google branch yet.
(They are included in this commit).
e7af147f979e657fe2df00808e5b4319b0e088c6,
baf87df3cb2683649ba7e9872362a7e721117c23, and
c231900e5dcc14d8296bd9f62b45997a49d4d5e7.
Change-Id: I4bea3ea470387ff751c2be4cb0d4a12059b9299b
Diffstat (limited to 'gcc-4.9/gcc/varasm.c')
-rw-r--r-- | gcc-4.9/gcc/varasm.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gcc-4.9/gcc/varasm.c b/gcc-4.9/gcc/varasm.c index 8e8c5f663..f4da29576 100644 --- a/gcc-4.9/gcc/varasm.c +++ b/gcc-4.9/gcc/varasm.c @@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see #include "targhooks.h" #include "cgraph.h" #include "pointer-set.h" +#include "l-ipo.h" #include "asan.h" #include "basic-block.h" @@ -1548,6 +1549,13 @@ notice_global_symbol (tree decl) || !MEM_P (DECL_RTL (decl))) return; + if (L_IPO_COMP_MODE + && ((TREE_CODE (decl) == FUNCTION_DECL + && cgraph_is_auxiliary (decl)) + || (TREE_CODE (decl) == VAR_DECL && varpool_get_node (decl) + && varpool_is_auxiliary (varpool_get_node (decl))))) + return; + /* We win when global object is found, but it is useful to know about weak symbol as well so we can produce nicer unique names. */ if (DECL_WEAK (decl) || DECL_ONE_ONLY (decl) || flag_shlib) @@ -2287,6 +2295,13 @@ assemble_external (tree decl ATTRIBUTE_UNUSED) If it's not, we should not be calling this function. */ gcc_assert (asm_out_file); + /* Processing pending items from auxiliary modules are not supported + which means platforms that requires ASM_OUTPUT_EXTERNAL may + have issues. (TODO : one way is to flush the pending items from + auxiliary modules at the end of parsing the module) */ + if (L_IPO_IS_AUXILIARY_MODULE) + return; + /* In a perfect world, the following condition would be true. Sadly, the Java and Go front ends emit assembly *from the front end*, bypassing the call graph. See PR52739. Fix before GCC 4.8. */ @@ -2370,7 +2385,7 @@ mark_decl_referenced (tree decl) functions can be marked reachable, just use the external definition. */ struct cgraph_node *node = cgraph_get_create_node (decl); - if (!DECL_EXTERNAL (decl) + if (!(DECL_EXTERNAL (decl) || cgraph_is_aux_decl_external (node)) && !node->definition) cgraph_mark_force_output_node (node); } @@ -5550,6 +5565,11 @@ do_assemble_alias (tree decl, tree target) if (TREE_ASM_WRITTEN (decl)) return; + if (L_IPO_COMP_MODE + && lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)) + && TREE_ASM_WRITTEN (DECL_ASSEMBLER_NAME (decl))) + return; + /* We must force creation of DECL_RTL for debug info generation, even though we don't use it here. */ make_decl_rtl (decl); @@ -5648,6 +5668,12 @@ assemble_alias (tree decl, tree target) { tree target_decl; + if (L_IPO_IS_AUXILIARY_MODULE) + { + if (!lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))) + return; + } + if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))) { tree alias = DECL_ASSEMBLER_NAME (decl); |