This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] Fix Ada bootstrap (was: 16: EH redirection)
> I do not know how to fix this properly. I can either make DCE to not
> remove unreachable blocks and remove them somewhere later, or simply
> drop DCE flag on DSE df_analyze or declare that it is up to caller to
> cleanup CFG after calling df_analyze with DCE flag when df_analyze
> somehow signalizes that it removed some throwing instructions or make
> DCE to update the bitmap?
Why not simply punt? The same problem happens within CSE for c41401a.adb:
Index: dce.c
===================================================================
--- dce.c (revision 146985)
+++ dce.c (working copy)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.
#include "regs.h"
#include "hard-reg-set.h"
#include "flags.h"
+#include "except.h"
#include "df.h"
#include "cselib.h"
#include "dce.h"
@@ -35,9 +36,6 @@ along with GCC; see the file COPYING3.
#include "dbgcnt.h"
#include "tm_p.h"
-DEF_VEC_I(int);
-DEF_VEC_ALLOC_I(int,heap);
-
/* -------------------------------------------------------------------------
Core mark/delete routines
@@ -118,6 +116,13 @@ deletable_insn_p (rtx insn, bool fast, b
if (!NONJUMP_INSN_P (insn))
return false;
+ /* Similarly, we cannot delete other insns that can throw inside of
+ the recursive dce. */
+ if (flag_non_call_exceptions
+ && df_in_progress
+ && can_throw_internal (insn))
+ return false;
+
body = PATTERN (insn);
switch (GET_CODE (body))
{
--
Eric Botcazou