This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC] Unconditionally clean up CFG before emitting prologue
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Apr 2012 11:55:25 +0200
- Subject: [RFC] Unconditionally clean up CFG before emitting prologue
Hi,
with the numerous checks generated in Ada, the gimplification process can
generated dead branches that aren't easily eliminated at -O0 and can impair
the debugging experience. We have found that unconditionally cleaning up the
CFG before emitting the prologue/epilogue can help in some cases. This is the
same idiom already used in rest_of_handle_jump2 for example.
Tested on x86_64-suse-linux. Comments?
2012-04-09 Eric Botcazou <ebotcazou@adacore.com>
* function.c (rest_of_handle_thread_prologue_and_epilogue): Clean up
the CFG before generating prologue/epilogue even when not optimizing.
--
Eric Botcazou
Index: function.c
===================================================================
--- function.c (revision 186176)
+++ function.c (working copy)
@@ -6877,8 +6877,7 @@ struct rtl_opt_pass pass_leaf_regs =
static unsigned int
rest_of_handle_thread_prologue_and_epilogue (void)
{
- if (optimize)
- cleanup_cfg (CLEANUP_EXPENSIVE);
+ cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
/* On some machines, the prologue and epilogue code, or parts thereof,
can be represented as RTL. Doing so lets us schedule insns between