From 46a4da10f5b00da1091d9641836f0550ce9a5120 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Fri, 24 Sep 2010 21:14:51 +0200 Subject: extend.texi: (attribute leaf): Document. * doc/extend.texi: (attribute leaf): Document. * tree.c (local_define_builtin): Handle ECF_LEAF. (build_common_builtin_nodes): Set ECF_LEAF where needed. * tree.h (ECF_LEAF): New. * ipa-reference.c (propagate_bits): For leaf calls propagate ever overwrittable and unavailable functions. (ipa_init): Put all_module_statics into optimization_summary_obstack. (copy_global_bitmap): Do not copy all_module_statics. (read_write_all_from_decl): Use cgraph_node argument; handle ECF_LEAF. (propagate): Handle overwritable and unavailable leaf functions; initialize global info for overwritable and unavailable leaf functions; do not free all module statics. (ipa_reference_get_not_read_global, ipa_reference_get_not_written_global): leaf calls don't clobber local statics. * calls.c (flags_from_decl_or_type): Handle leaf. * tree-cfg.c (stmt_can_make_abnormal_goto): Leaf functions can't do abnormal gotos. * c-common.c (handle_leaf_attribute): New function. (struct attribute_spec c_common_att): Add leaf. * gcc.dg/tree-ssa/leaf.c: New testcase. From-SVN: r164606 --- gcc/tree-cfg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/tree-cfg.c') diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index be8a84f..cf67fb8 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -2258,7 +2258,8 @@ is_ctrl_altering_stmt (gimple t) /* A non-pure/const call alters flow control if the current function has nonlocal labels. */ - if (!(flags & (ECF_CONST | ECF_PURE)) && cfun->has_nonlocal_label) + if (!(flags & (ECF_CONST | ECF_PURE | ECF_LEAF)) + && cfun->has_nonlocal_label) return true; /* A call also alters control flow if it does not return. */ @@ -2314,7 +2315,8 @@ stmt_can_make_abnormal_goto (gimple t) if (computed_goto_p (t)) return true; if (is_gimple_call (t)) - return gimple_has_side_effects (t) && cfun->has_nonlocal_label; + return (gimple_has_side_effects (t) && cfun->has_nonlocal_label + && !(gimple_call_flags (t) & ECF_LEAF)); return false; } -- cgit v1.1