aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-03-26 03:11:57 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2014-03-26 02:11:57 +0000
commit9de6f6c3eed463e8c41b95a28ad7f2186e379fff (patch)
tree58c27722a6391d91e8bbfcb902c1edc28e754d14 /gcc/cgraph.c
parentd7636f5609dc4325d145b82adc9dd977d079303e (diff)
downloadgcc-9de6f6c3eed463e8c41b95a28ad7f2186e379fff.zip
gcc-9de6f6c3eed463e8c41b95a28ad7f2186e379fff.tar.gz
gcc-9de6f6c3eed463e8c41b95a28ad7f2186e379fff.tar.bz2
re PR ipa/60315 (template constructor switch optimization)
PR ipa/60315 * cif-code.def (UNREACHABLE) New code. * ipa-inline.c (inline_small_functions): Skip edges to __builtlin_unreachable. (estimate_edge_growth): Allow edges to __builtlin_unreachable. * ipa-inline-analysis.c (edge_set_predicate): Redirect edges with false predicate to __bulitin_unreachable. (set_cond_stmt_execution_predicate): Fix issue when invert_tree_comparison returns ERROR_MARK. * ipa-pure-const.c (propagate_pure_const, propagate_nothrow): Do not propagate to inline clones. * cgraph.c (verify_edge_corresponds_to_fndecl): Allow redirection to unreachable. * ipa-cp.c (create_specialized_node): Be ready for new node to appear. * cgraphclones.c (cgraph_clone_node): If call destination is already ureachable, do not redirect it back. * tree-inline.c (fold_marked_statements): Hanlde calls becoming unreachable. From-SVN: r208831
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index abfd63c..586ef79 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2612,6 +2612,12 @@ verify_edge_corresponds_to_fndecl (struct cgraph_edge *e, tree decl)
|| node->in_other_partition
|| e->callee->in_other_partition)
return false;
+
+ /* Optimizers can redirect unreachable calls or calls triggering undefined
+ behaviour to builtin_unreachable. */
+ if (DECL_BUILT_IN_CLASS (e->callee->decl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (e->callee->decl) == BUILT_IN_UNREACHABLE)
+ return false;
node = cgraph_function_or_thunk_node (node, NULL);
if (e->callee->former_clone_of != node->decl