This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
flow patch for n_basic_blocks
- To: egcs-patches at cygnus dot com
- Subject: flow patch for n_basic_blocks
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 8 Oct 1998 16:34:53 -0700
- Reply-To: Richard Henderson <rth at cygnus dot com>
Flow misinterprets the call in
(call_insn 15 13 16 (set (reg:SI 0 %eax)
(call (mem:QI (symbol_ref:SI ("__9streambufi")) 0)
(const_int 8))) -1 (nil)
(nil)
(nil))
(note 16 15 18 196 NOTE_INSN_EH_REGION_BEG)
(insn 18 16 20 (set (mem/s:SI (plus:SI (reg/v/u:SI 22)
(const_int 76)) 135)
(symbol_ref:SI ("__vt_7filebuf"))) 54 {movsi+2} (nil)
(nil))
as starting a basic block, because the test for if we are in an eh
region happens at the subsequent instruction.
I accidentally fixed this while cleaning up comments in last night's
flow fixes. Except that the wrong number was still being calculated
elsewhere, leading to aborts building libio.
I've committed the following fix.
r~
* flow.c (find_basic_blocks): Correctly determine if a call
was in an eh region.
Index: flow.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/flow.c,v
retrieving revision 1.64
diff -c -p -d -r1.64 flow.c
*** flow.c 1998/10/08 01:26:17 1.64
--- flow.c 1998/10/08 21:39:28
*************** find_basic_blocks (f, nregs, file, live_
*** 314,319 ****
--- 314,320 ----
register RTX_CODE prev_code = JUMP_INSN;
register RTX_CODE code;
int eh_region = 0;
+ int call_had_abnormal_edge = 0;
max_uid_for_flow = 0;
*************** find_basic_blocks (f, nregs, file, live_
*** 335,341 ****
i++;
else if (prev_code == CALL_INSN)
{
! if (nonlocal_label_list != 0 || eh_region)
i++;
else
{
--- 336,342 ----
i++;
else if (prev_code == CALL_INSN)
{
! if (call_had_abnormal_edge)
i++;
else
{
*************** find_basic_blocks (f, nregs, file, live_
*** 359,364 ****
--- 360,369 ----
new block. */
if (code == CALL_INSN && in_libcall_block)
code = INSN;
+
+ /* Record whether this call created an edge. */
+ if (code == CALL_INSN)
+ call_had_abnormal_edge = (nonlocal_label_list != 0 || eh_region);
if (code != NOTE)
prev_code = code;