From 2c3a56ad15b80efe217db30809f6260d3496b63a Mon Sep 17 00:00:00 2001 From: Jeffrey A Law Date: Sat, 27 Dec 1997 23:34:14 +0000 Subject: [PATCH] flow.c (find_basic_blocks): Don't create a new basic block for calls in a LIBCALL block. * flow.c (find_basic_blocks): Don't create a new basic block for calls in a LIBCALL block. From-SVN: r17247 --- gcc/ChangeLog | 5 +++++ gcc/flow.c | 28 +++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 898cc852473..05ecb58e73f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Sun Dec 28 00:32:16 1997 Jeffrey A Law (law@cygnus.com) + + * flow.c (find_basic_blocks): Don't create a new basic block + for calls in a LIBCALL block. + Sun Dec 28 00:30:24 1997 David Edelsohn * config/fp-bit.c (L_df_to_sf): Fix typo in last change. diff --git a/gcc/flow.c b/gcc/flow.c index 69c7d6b4805..55516b4bdf6 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -284,6 +284,7 @@ flow_analysis (f, nregs, file) register rtx insn; register int i; rtx nonlocal_label_list = nonlocal_label_rtx_list (); + int in_libcall_block = 0; #ifdef ELIMINABLE_REGS static struct {int from, to; } eliminables[] = ELIMINABLE_REGS; @@ -312,6 +313,12 @@ flow_analysis (f, nregs, file) for (insn = f, i = 0; insn; insn = NEXT_INSN (insn)) { + + /* Track when we are inside in LIBCALL block. */ + if (GET_RTX_CLASS (GET_CODE (insn)) == 'i' + && find_reg_note (insn, REG_LIBCALL, NULL_RTX)) + in_libcall_block = 1; + code = GET_CODE (insn); if (INSN_UID (insn) > max_uid_for_flow) max_uid_for_flow = INSN_UID (insn); @@ -320,7 +327,7 @@ flow_analysis (f, nregs, file) && (prev_code == JUMP_INSN || (prev_code == CALL_INSN && (nonlocal_label_list != 0 || eh_region) - && ! find_reg_note (insn, REG_RETVAL, NULL_RTX)) + && ! in_libcall_block) || prev_code == BARRIER))) i++; @@ -333,6 +340,10 @@ flow_analysis (f, nregs, file) ++eh_region; else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END) --eh_region; + + if (GET_RTX_CLASS (GET_CODE (insn)) == 'i' + && find_reg_note (insn, REG_RETVAL, NULL_RTX)) + in_libcall_block = 0; } } @@ -389,6 +400,7 @@ find_basic_blocks (f, nonlocal_label_list) rtx x, note, eh_note; enum rtx_code prev_code, code; int depth, pass; + int in_libcall_block = 0; pass = 1; active_eh_handler = (rtx *) alloca ((max_uid_for_flow + 1) * sizeof (rtx)); @@ -412,6 +424,12 @@ find_basic_blocks (f, nonlocal_label_list) for (eh_note = NULL_RTX, insn = f, i = -1, prev_code = JUMP_INSN, depth = 1; insn; insn = NEXT_INSN (insn)) { + + /* Track when we are inside in LIBCALL block. */ + if (GET_RTX_CLASS (GET_CODE (insn)) == 'i' + && find_reg_note (insn, REG_LIBCALL, NULL_RTX)) + in_libcall_block = 1; + code = GET_CODE (insn); if (code == NOTE) { @@ -427,7 +445,7 @@ find_basic_blocks (f, nonlocal_label_list) && (prev_code == JUMP_INSN || (prev_code == CALL_INSN && (nonlocal_label_list != 0 || eh_note) - && ! find_reg_note (insn, REG_RETVAL, NULL_RTX)) + && ! in_libcall_block) || prev_code == BARRIER))) { basic_block_head[++i] = insn; @@ -485,13 +503,17 @@ find_basic_blocks (f, nonlocal_label_list) else if (eh_note && (asynchronous_exceptions || (GET_CODE (insn) == CALL_INSN - && ! find_reg_note (insn, REG_RETVAL, NULL_RTX)))) + && ! in_libcall_block))) active_eh_handler[INSN_UID (insn)] = XEXP (eh_note, 0); BLOCK_NUM (insn) = i; if (code != NOTE) prev_code = code; + + if (GET_RTX_CLASS (GET_CODE (insn)) == 'i' + && find_reg_note (insn, REG_RETVAL, NULL_RTX)) + in_libcall_block = 0; } /* During the second pass, `n_basic_blocks' is only an upper bound.