This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
cfg merge part 13 - random fixes
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Date: Sun, 5 May 2002 23:55:56 +0200
- Subject: cfg merge part 13 - random fixes
Sun May 5 23:42:39 CEST 2002 Jan Hubicka <jh@suse.cz>
* cfgbuild.c (make_edges): Don't miss empty blocks.
(compute_outgoing_frequencies): Cleanup.
* cfgrtl.c (flow_delete_block_noexpunge): Do not skip empty
blocks.
Index: cfgbuild.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgbuild.c,v
retrieving revision 1.13
retrieving revision 1.8.4.7
diff -c -3 -p -r1.13 -r1.8.4.7
*** cfgbuild.c 30 Mar 2002 22:49:56 -0000 1.13
--- cfgbuild.c 19 Apr 2002 22:44:40 -0000 1.8.4.7
*************** make_edges (label_value_list, min, max,
*** 442,456 ****
}
/* Find out if we can drop through to the next block. */
! insn = next_nonnote_insn (insn);
if (!insn || (i + 1 == n_basic_blocks && force_fallthru))
cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
else if (i + 1 < n_basic_blocks)
{
! rtx tmp = BLOCK_HEAD (i + 1);
! if (GET_CODE (tmp) == NOTE)
! tmp = next_nonnote_insn (tmp);
! if (force_fallthru || insn == tmp)
cached_make_edge (edge_cache, bb, BASIC_BLOCK (i + 1),
EDGE_FALLTHRU);
}
--- 440,456 ----
}
/* Find out if we can drop through to the next block. */
! insn = NEXT_INSN (insn);
! while (insn
! && GET_CODE (insn) == NOTE
! && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK)
! insn = NEXT_INSN (insn);
!
if (!insn || (i + 1 == n_basic_blocks && force_fallthru))
cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
else if (i + 1 < n_basic_blocks)
{
! if (force_fallthru || insn == BLOCK_HEAD (i + 1))
cached_make_edge (edge_cache, bb, BASIC_BLOCK (i + 1),
EDGE_FALLTHRU);
}
*************** compute_outgoing_frequencies (b)
*** 763,771 ****
if (!note)
return;
! probability = INTVAL (XEXP (find_reg_note (b->end,
! REG_BR_PROB, NULL),
! 0));
e = BRANCH_EDGE (b);
e->probability = probability;
e->count = ((b->count * probability + REG_BR_PROB_BASE / 2)
--- 767,773 ----
if (!note)
return;
! probability = INTVAL (XEXP (note, 0));
e = BRANCH_EDGE (b);
e->probability = probability;
e->count = ((b->count * probability + REG_BR_PROB_BASE / 2)
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgrtl.c,v
retrieving revision 1.40
diff -c -3 -p -r1.40 cfgrtl.c
*** cfgrtl.c 27 Apr 2002 06:41:38 -0000 1.40
--- cfgrtl.c 5 May 2002 21:13:05 -0000
*************** flow_delete_block_noexpunge (b)
*** 393,399 ****
end = tmp;
/* Include any barrier that may follow the basic block. */
! tmp = next_nonnote_insn (end);
if (tmp && GET_CODE (tmp) == BARRIER)
end = tmp;
--- 412,422 ----
end = tmp;
/* Include any barrier that may follow the basic block. */
! for (tmp = NEXT_INSN (end);
! tmp && GET_CODE (tmp) == NOTE
! && NOTE_LINE_NUMBER (tmp) != NOTE_INSN_BASIC_BLOCK;
! tmp = NEXT_INSN (tmp))
! ;
if (tmp && GET_CODE (tmp) == BARRIER)
end = tmp;