+2005-05-14 Jan Hubicka <jh@suse.cz>
+
+ * tree-cfg.c (execute_warn_function_return): Break out noreturn
+ warning too..
+ (execute_warn_function_noreturn): ... here.
+ (pass_warn_function_noreturn): New pass.
+ * tree-pass.h (pass_warn_function_noreturn): Declare
+ * tree-optimize.c (init_tree_optimization_passes): Move return
+ warnings early and add noreturn warnings at place of previous
+ return warnings.
+
2005-05-14 Kazu Hirata <kazu@cs.umass.edu>
* tree-ssa-live.c (tpa_init, tpa_delete, tpa_compact,
edge e;
edge_iterator ei;
- if (warn_missing_noreturn
- && !TREE_THIS_VOLATILE (cfun->decl)
- && EDGE_COUNT (EXIT_BLOCK_PTR->preds) == 0
- && !lang_hooks.function.missing_noreturn_ok_p (cfun->decl))
- warning (0, "%Jfunction might be possible candidate for "
- "attribute %<noreturn%>",
- cfun->decl);
-
/* If we have a path to EXIT, then we do return. */
if (TREE_THIS_VOLATILE (cfun->decl)
&& EDGE_COUNT (EXIT_BLOCK_PTR->preds) > 0)
0, /* todo_flags_finish */
0 /* letter */
};
+
+/* Emit noreturn warnings. */
+
+static void
+execute_warn_function_noreturn (void)
+{
+ if (warn_missing_noreturn
+ && !TREE_THIS_VOLATILE (cfun->decl)
+ && EDGE_COUNT (EXIT_BLOCK_PTR->preds) == 0
+ && !lang_hooks.function.missing_noreturn_ok_p (cfun->decl))
+ warning (0, "%Jfunction might be possible candidate for "
+ "attribute %<noreturn%>",
+ cfun->decl);
+}
+
+struct tree_opt_pass pass_warn_function_noreturn =
+{
+ NULL, /* name */
+ NULL, /* gate */
+ execute_warn_function_noreturn, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ 0, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
+ 0 /* letter */
+};
NEXT_PASS (pass_lower_eh);
NEXT_PASS (pass_build_cfg);
NEXT_PASS (pass_pre_expand);
+ NEXT_PASS (pass_warn_function_return);
NEXT_PASS (pass_tree_profile);
NEXT_PASS (pass_init_datastructures);
NEXT_PASS (pass_all_optimizations);
- NEXT_PASS (pass_warn_function_return);
+ NEXT_PASS (pass_warn_function_noreturn);
NEXT_PASS (pass_mudflap_2);
NEXT_PASS (pass_free_datastructures);
NEXT_PASS (pass_expand);
extern struct tree_opt_pass pass_early_warn_uninitialized;
extern struct tree_opt_pass pass_late_warn_uninitialized;
extern struct tree_opt_pass pass_warn_function_return;
+extern struct tree_opt_pass pass_warn_function_noreturn;
extern struct tree_opt_pass pass_phiopt;
extern struct tree_opt_pass pass_forwprop;
extern struct tree_opt_pass pass_redundant_phi;