This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix eh ICE with -foptimize-sibling-calls
> On Fri, Jan 11, 2002 at 05:13:24PM +0100, Jakub Jelinek wrote:
> > * calls.c (expand_call): If there were any cleanups emitted in
> > tail call chain, remove any eh regions contained in it.
> > * except.c (init_eh_for_function, free_eh_status): Clean
> > exception_handler_labels.
> > (remove_exception_handler_label): Do nothing if
> > find_exception_handlers has not been called yet.
> > (remove_eh_handler): Make it work even before region_array
> > is computed.
> > (maybe_remove_eh_handler): Likewise.
>
> I think it might make more sense to have convert_from_eh_regions
> mark regions that are still used, and remove those that aren't.
>
> That would solve this case, plus any other instance in which we
> discard code without linking it into the chain. Which seems a
> bit more robust.
On related note, on the cfg-branch I've hit problems with cfg_cleanup
running multipole times before finish_eh_generation - I believe it is
still one in mainline, but the problem there was that cfg_cleanup
frees for some purpose the tail_recursion_labels list that is of course
wrong, it should be done by sibcall.c.
BTW where is the proper place to free label_value_list?
Sat Jan 12 17:57:01 CET 2002 Jan Hubicka <jh@suse.cz>
* sibcall.c (optimize_sibling_and_tail_recursive_call): Free tail_recursion_label_list.
* cfgcleanup.c (cleanup_cfg): Do not free it here.
*** sibcall.c Sun Oct 28 21:09:16 2001
--- /home/hubicka/egcs/gcc/sibcall.c Sun Dec 30 17:20:53 2001
*************** optimize_sibling_and_tail_recursive_call
*** 759,762 ****
--- 749,753 ----
/* This information will be invalid after inline expansion. Kill it now. */
free_basic_block_vars (0);
+ free_EXPR_LIST_list (&tail_recursion_label_list);
}
*** cfgcleanup.c Sat Jan 12 17:04:51 2002
--- /home/hubicka/egcs/gcc/cfgcleanup.c Sat Jan 12 17:27:15 2002
*************** cleanup_cfg (mode)
*** 1738,1749 ****
timevar_push (TV_CLEANUP_CFG);
changed = delete_unreachable_blocks ();
if (try_optimize_cfg (mode))
delete_unreachable_blocks (), changed = true;
/* Kill the data we won't maintain. */
free_EXPR_LIST_list (&label_value_list);
- free_EXPR_LIST_list (&tail_recursion_label_list);
timevar_pop (TV_CLEANUP_CFG);
return changed;
--- 1742,1756 ----