This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: cause of all the mainline Sparc regressions
From: Jan Hubicka <jh@suse.cz>
Date: Thu, 23 May 2002 16:23:07 +0200
Hmm, unless I am mistaken, only purpose for finish_eh_gneration to
cleanup cfg is to kill unreachable code. I guess in that case, it would
be better to dirrectly call delete_unreachable_blocks and since this is
already done, perhaps we don't need anything.
But if you delete unreachable blocks, shouldn't you optimize the
CFG in the hopes that EH will end up doing less work?
I think we should just add the new flag bit and keep things the
way it is. I'm going to check the following for now, so people
can get work done. And if we find a better solution, my change
can be reverted.
Ok?
--- basic-block.h.~1~ Tue May 21 00:43:56 2002
+++ basic-block.h Thu May 23 05:28:49 2002
@@ -595,6 +595,8 @@ enum update_life_extent
notes. */
#define CLEANUP_UPDATE_LIFE 32 /* Keep life information up to date. */
#define CLEANUP_THREADING 64 /* Do jump threading. */
+#define CLEANUP_NO_INSN_DEL 128 /* Do not try to delete trivially dead
+ insns. */
/* Flags for loop discovery. */
#define LOOP_TREE 1 /* Build loop hierarchy tree. */
--- cfgcleanup.c.~1~ Wed May 22 22:16:27 2002
+++ cfgcleanup.c Thu May 23 05:29:14 2002
@@ -1800,7 +1800,8 @@ cleanup_cfg (mode)
changed = true;
/* We've possibly created trivially dead code. Cleanup it right
now to introduce more oppurtunities for try_optimize_cfg. */
- if (!(mode & (CLEANUP_UPDATE_LIFE | CLEANUP_PRE_SIBCALL))
+ if (!(mode & (CLEANUP_NO_INSN_DEL
+ | CLEANUP_UPDATE_LIFE | CLEANUP_PRE_SIBCALL))
&& !reload_completed)
delete_trivially_dead_insns (get_insns(), max_reg_num ());
}
@@ -1819,7 +1820,8 @@ cleanup_cfg (mode)
| PROP_LOG_LINKS))
break;
}
- else if (!(mode & CLEANUP_PRE_SIBCALL) && !reload_completed)
+ else if (!(mode & (CLEANUP_NO_INSN_DEL | CLEANUP_PRE_SIBCALL))
+ && !reload_completed)
{
if (!delete_trivially_dead_insns (get_insns(), max_reg_num ()))
break;
--- except.c.~1~ Sun Apr 28 21:54:55 2002
+++ except.c Thu May 23 05:29:38 2002
@@ -2501,7 +2501,7 @@ finish_eh_generation ()
rebuild_jump_labels (get_insns ());
find_basic_blocks (get_insns (), max_reg_num (), 0);
- cleanup_cfg (CLEANUP_PRE_LOOP);
+ cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
/* These registers are used by the landing pads. Make sure they
have been generated. */
@@ -2524,7 +2524,7 @@ finish_eh_generation ()
find_exception_handler_labels ();
rebuild_jump_labels (get_insns ());
find_basic_blocks (get_insns (), max_reg_num (), 0);
- cleanup_cfg (CLEANUP_PRE_LOOP);
+ cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
}
static hashval_t
--- toplev.c.~1~ Wed May 22 22:16:29 2002
+++ toplev.c Thu May 23 04:43:25 2002
@@ -2574,7 +2574,10 @@ rest_of_compilation (decl)
unshare_all_rtl (current_function_decl, insns);
#ifdef SETJMP_VIA_SAVE_AREA
- /* This must be performed before virtual register instantiation. */
+ /* This must be performed before virtual register instantiation.
+ Please be aware the everything in the compiler that can look
+ at the RTL up to this point must understand that REG_SAVE_AREA
+ is just like a use of the REG contained inside. */
if (current_function_calls_alloca)
optimize_save_area_alloca (insns);
#endif