This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix latent reload bug
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, aj at suse dot de, zlomekj at suse dot cz
- Date: Mon, 30 Dec 2002 21:38:50 +0100
- Subject: Fix latent reload bug
Hi,
reload may create new trapping insns when the reloads for trapping loads
are produced and -fnoncall-exceptions is in effect. This patch should
care it, but it is somewhat zelaous.
OK for mainline? Or any ideas for chaper fix?
I am installing it to rtlopt branch. The first change (sanity check for
the problem) matches on libjava compilation.
Andreas, Josef: This should fix the failures you are seeing.
Honza
Mon Dec 30 21:35:29 CET 2002 Jan Hubicka <jh@suse.cz>
* cfgrtl.c (verify_flow_info): Use control_flow_insn_p.
* reload1.c (fixup_abnormal_edges): Split basic blocks when EH edges
possibly got duplicated.
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.58.4.5
diff -c -3 -p -r1.58.4.5 cfgrtl.c
*** cfgrtl.c 18 Dec 2002 10:35:02 -0000 1.58.4.5
--- cfgrtl.c 30 Dec 2002 20:33:54 -0000
*************** verify_flow_info ()
*** 2024,2032 ****
if (x == bb->end)
break;
! if (GET_CODE (x) == JUMP_INSN
! || GET_CODE (x) == CODE_LABEL
! || GET_CODE (x) == BARRIER)
{
error ("in basic block %d:", bb->index);
fatal_insn ("flow control insn inside a basic block", x);
--- 2024,2030 ----
if (x == bb->end)
break;
! if (control_flow_insn_p (x))
{
error ("in basic block %d:", bb->index);
fatal_insn ("flow control insn inside a basic block", x);
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.354.2.7
diff -c -3 -p -r1.354.2.7 reload1.c
*** reload1.c 23 Dec 2002 13:58:27 -0000 1.354.2.7
--- reload1.c 30 Dec 2002 20:33:58 -0000
*************** fixup_abnormal_edges ()
*** 9515,9520 ****
--- 9515,9528 ----
}
}
}
+ /* We've possibly turned single trapping insn into multiple ones. */
+ if (flag_non_call_exceptions)
+ {
+ sbitmap blocks;
+ blocks = sbitmap_alloc (last_basic_block);
+ sbitmap_ones (blocks);
+ find_many_sub_basic_blocks (blocks);
+ }
if (inserted)
commit_edge_insertions ();
}