diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-22 13:18:48 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-22 13:18:48 +0000 |
commit | 10ac3b61d47f112a00af9f3f371004dc7f6f67c2 (patch) | |
tree | 9955bf63053ef899a56cecced5b989e2239a8063 /gcc/cgraphbuild.c | |
parent | c275e9eabf8ae5737c866d88f53e33d15621d5e4 (diff) | |
download | gcc-10ac3b61d47f112a00af9f3f371004dc7f6f67c2.tar.gz |
2010-11-22 Richard Guenther <rguenther@suse.de>
* gimple-fold.c (maybe_fold_reference): When canonicalizing
MEM_REFs, preserve volatileness.
* cgraphbuild.c (mark_address): Properly check for FUNCTION_DECL
addresses.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167030 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphbuild.c')
-rw-r--r-- | gcc/cgraphbuild.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c index f9d70dbb792..d8d196fd0da 100644 --- a/gcc/cgraphbuild.c +++ b/gcc/cgraphbuild.c @@ -237,6 +237,7 @@ static bool mark_address (gimple stmt ATTRIBUTE_UNUSED, tree addr, void *data ATTRIBUTE_UNUSED) { + addr = get_base_address (addr); if (TREE_CODE (addr) == FUNCTION_DECL) { struct cgraph_node *node = cgraph_node (addr); @@ -245,24 +246,20 @@ mark_address (gimple stmt ATTRIBUTE_UNUSED, tree addr, node, NULL, IPA_REF_ADDR, stmt); } - else + else if (addr && TREE_CODE (addr) == VAR_DECL + && (TREE_STATIC (addr) || DECL_EXTERNAL (addr))) { - addr = get_base_address (addr); - if (addr && TREE_CODE (addr) == VAR_DECL - && (TREE_STATIC (addr) || DECL_EXTERNAL (addr))) - { - struct varpool_node *vnode = varpool_node (addr); - int walk_subtrees; + struct varpool_node *vnode = varpool_node (addr); + int walk_subtrees; - if (lang_hooks.callgraph.analyze_expr) - lang_hooks.callgraph.analyze_expr (&addr, &walk_subtrees); - varpool_mark_needed_node (vnode); - if (vnode->alias && vnode->extra_name) - vnode = vnode->extra_name; - ipa_record_reference ((struct cgraph_node *)data, NULL, - NULL, vnode, - IPA_REF_ADDR, stmt); - } + if (lang_hooks.callgraph.analyze_expr) + lang_hooks.callgraph.analyze_expr (&addr, &walk_subtrees); + varpool_mark_needed_node (vnode); + if (vnode->alias && vnode->extra_name) + vnode = vnode->extra_name; + ipa_record_reference ((struct cgraph_node *)data, NULL, + NULL, vnode, + IPA_REF_ADDR, stmt); } return false; |