This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
flow patch for g++ bug
- To: egcs-patches at cygnus dot com
- Subject: flow patch for g++ bug
- From: Jim Wilson <wilson at cygnus dot com>
- Date: Mon, 21 Sep 1998 14:04:26 -0700
I checked in this patch today. This was reviewed by Jeff Law. This fixes
two problems.
1) The basic block partition code in find_basic_blocks does not match the
equivalent code in find_basic_blocks_1.
2) The code in find_basic_blocks_1 for handling libcalls does not work if
the REG_RETVAL note is on the CALL_INSN instead of on the following insn.
This can happen if these flow routines are called after combine.
Mon Sep 14 20:14:34 1998 Jim Wilson <wilson@cygnus.com>
* flow.c (find_basic_blocks): Delete check for in_libcall_block when
prev_code is a CALL_INSN. Change check for REG_RETVAL note to
use in_libcall_block.
(find_basic_blocks_1): Delete check for in_libcall_block when prev_code
is a CALL_INSN. If CALL_INSN and in_libcall_block, then change code
to INSN.
Index: flow.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/flow.c,v
retrieving revision 1.132
diff -p -r1.132 flow.c
*** flow.c 1998/08/21 07:29:37 1.132
--- flow.c 1998/09/15 03:13:59
*************** find_basic_blocks (f, nregs, file, live_
*** 332,343 ****
|| (GET_RTX_CLASS (code) == 'i'
&& (prev_code == JUMP_INSN
|| (prev_code == CALL_INSN
! && (nonlocal_label_list != 0 || eh_region)
! && ! in_libcall_block)
|| prev_code == BARRIER)))
i++;
! if (code == CALL_INSN && find_reg_note (insn, REG_RETVAL, NULL_RTX))
code = INSN;
if (code != NOTE)
--- 332,344 ----
|| (GET_RTX_CLASS (code) == 'i'
&& (prev_code == JUMP_INSN
|| (prev_code == CALL_INSN
! && (nonlocal_label_list != 0 || eh_region))
|| prev_code == BARRIER)))
i++;
! /* We change the code of the CALL_INSN, so that it won't start a
! new block. */
! if (code == CALL_INSN && in_libcall_block)
code = INSN;
if (code != NOTE)
*************** find_basic_blocks_1 (f, nonlocal_label_l
*** 457,464 ****
|| (GET_RTX_CLASS (code) == 'i'
&& (prev_code == JUMP_INSN
|| (prev_code == CALL_INSN
! && (nonlocal_label_list != 0 || eh_note)
! && ! in_libcall_block)
|| prev_code == BARRIER)))
{
basic_block_head[++i] = insn;
--- 458,464 ----
|| (GET_RTX_CLASS (code) == 'i'
&& (prev_code == JUMP_INSN
|| (prev_code == CALL_INSN
! && (nonlocal_label_list != 0 || eh_note))
|| prev_code == BARRIER)))
{
basic_block_head[++i] = insn;
*************** find_basic_blocks_1 (f, nonlocal_label_l
*** 518,523 ****
--- 518,528 ----
active_eh_region[INSN_UID (insn)] =
NOTE_BLOCK_NUMBER (XEXP (eh_note, 0));
BLOCK_NUM (insn) = i;
+
+ /* We change the code of the CALL_INSN, so that it won't start a
+ new block. */
+ if (code == CALL_INSN && in_libcall_block)
+ code = INSN;
if (code != NOTE)
prev_code = code;