diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-01-05 09:40:50 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-01-05 09:40:50 +0100 |
commit | 566f27e42ca00f65d101e6a7b0096554a0cc452d (patch) | |
tree | 53dddb0634d26df31297a6db047145d050b904b2 /gcc/cgraphunit.c | |
parent | 11492349fe6f6a568b3aecdc1a503f80b8848070 (diff) | |
download | gcc-566f27e42ca00f65d101e6a7b0096554a0cc452d.zip gcc-566f27e42ca00f65d101e6a7b0096554a0cc452d.tar.gz gcc-566f27e42ca00f65d101e6a7b0096554a0cc452d.tar.bz2 |
re PR tree-optimization/42508 (wrong code with "-O1 -fipa-sra")
PR tree-optimization/42508
* tree-sra.c (convert_callers): Check for recursive call
by comparing cgraph nodes instead of decls.
(modify_function): Call ipa_modify_formal_parameters also
on all same_body aliases.
* g++.dg/opt/pr42508.C: New test.
* cgraphunit.c (cgraph_materialize_all_clones): Compare
cgraph nodes when checking for same_body aliases.
From-SVN: r155640
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index cf1a001..ebe662a 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1,5 +1,5 @@ /* Callgraph based interprocedural optimizations. - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Jan Hubicka @@ -2323,20 +2323,9 @@ cgraph_materialize_all_clones (void) gimple new_stmt; gimple_stmt_iterator gsi; - if (e->callee->same_body) - { - struct cgraph_node *alias; - - for (alias = e->callee->same_body; - alias; - alias = alias->next) - if (decl == alias->decl) - break; - /* Don't update call from same body alias to the real - function. */ - if (alias) - continue; - } + if (cgraph_get_node (decl) == cgraph_get_node (e->callee->decl)) + /* Don't update call from same body alias to the real function. */ + continue; if (cgraph_dump_file) { |