This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
latent bug in unreachable code removal?
- To: gcc at gcc dot gnu dot org, rth at cygnus dot com
- Subject: latent bug in unreachable code removal?
- From: Jan Hubicka <jh at suse dot cz>
- Date: Tue, 17 Jul 2001 14:39:36 +0200
Hi,
I've implemented following sanity check to avoid removal of LABEL_PRESERVE_P labels:
*** flow.c.old Tue Jul 17 14:34:37 2001
--- flow.c Tue Jul 17 14:34:49 2001
*************** can_delete_label_p (label)
*** 2682,2688 ****
rtx x;
if (LABEL_PRESERVE_P (label))
! return 0;
for (x = forced_labels; x; x = XEXP (x, 1))
if (label == XEXP (x, 0))
--- 2682,2688 ----
rtx x;
if (LABEL_PRESERVE_P (label))
! abort ();
for (x = forced_labels; x; x = XEXP (x, 1))
if (label == XEXP (x, 0))
And I've got hit - the code to remove unreachable blocks just blast them off,
even when have this flag, so they should be reachable via nested function calls.
There are few optinos to fix:
1) fix find_unreachable_blocks to adds roots to each such label
2) make edge from ENTRY_BLOCK_PTR to each such label
3) make edge from each nested function call to each such label.
3) looks like correct solution, as 1) is just papering around the problem
and 2) will cause troubles at prologue generation.
Unfortunately 3) seems to be out of my reach. How do I detect the nested
function call?
Honza