This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
cfgbuild cleanup
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Date: Sat, 30 Mar 2002 23:54:05 +0100
- Subject: cfgbuild cleanup
Hi,
The situation about creating basic block is little bit confused - first aux
is set to BB address and then cleared by create_basic_block, as we used to
do before create_basic_block_structure has been broken out of cfgbuild.
This patch cleans it up somewhat making watchpoints more effective during
debugging.
Bootstrapped/regtested i386.
Sat Mar 30 23:42:30 CET 2002 Jan Hubicka <jh@suse.cz>
* cfgbuild.c (find_basic_blocks_1): Mark aux fields by hand.
* cfgrtl.c (create_basic_block_strukcture): Clear aux field.
(create_basic_block): Do not clear aux.
Index: cfgbuild.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgbuild.c,v
retrieving revision 1.12
diff -c -3 -p -r1.12 cfgbuild.c
*** cfgbuild.c 2001/12/22 15:51:07 1.12
--- cfgbuild.c 2002/03/30 22:41:17
*************** find_basic_blocks_1 (f)
*** 476,481 ****
--- 476,482 ----
rtx trll = NULL_RTX;
rtx head = NULL_RTX;
rtx end = NULL_RTX;
+ basic_block bb;
/* We process the instructions in a slightly different way than we did
previously. This is so that we see a NOTE_BASIC_BLOCK after we have
*************** find_basic_blocks_1 (f)
*** 492,498 ****
if ((GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == BARRIER)
&& head)
{
! create_basic_block_structure (i++, head, end, bb_note);
head = end = NULL_RTX;
bb_note = NULL_RTX;
}
--- 493,502 ----
if ((GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == BARRIER)
&& head)
{
! bb = create_basic_block_structure (i++, head, end, bb_note);
! /* Tag the block so that we know it has been used when considering
! other basic block notes. */
! bb->aux = bb;
head = end = NULL_RTX;
bb_note = NULL_RTX;
}
*************** find_basic_blocks_1 (f)
*** 506,512 ****
if (head && control_flow_insn_p (insn))
{
! create_basic_block_structure (i++, head, end, bb_note);
head = end = NULL_RTX;
bb_note = NULL_RTX;
}
--- 510,519 ----
if (head && control_flow_insn_p (insn))
{
! bb = create_basic_block_structure (i++, head, end, bb_note);
! /* Tag the block so that we know it has been used when considering
! other basic block notes. */
! bb->aux = bb;
head = end = NULL_RTX;
bb_note = NULL_RTX;
}
*************** find_basic_blocks_1 (f)
*** 588,594 ****
}
if (head != NULL_RTX)
! create_basic_block_structure (i++, head, end, bb_note);
else if (bb_note)
delete_insn (bb_note);
--- 595,606 ----
}
if (head != NULL_RTX)
! {
! bb = create_basic_block_structure (i++, head, end, bb_note);
! /* Tag the block so that we know it has been used when considering
! other basic block notes. */
! bb->aux = bb;
! }
else if (bb_note)
delete_insn (bb_note);
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgrtl.c,v
retrieving revision 1.38
diff -c -3 -p -r1.38 cfgrtl.c
*** cfgrtl.c 2002/03/27 21:56:50 1.38
--- cfgrtl.c 2002/03/30 22:43:37
*************** create_basic_block_structure (index, hea
*** 311,324 ****
bb->end = end;
bb->index = index;
bb->flags = BB_NEW;
BASIC_BLOCK (index) = bb;
if (basic_block_for_insn)
update_bb_for_insn (bb);
- /* Tag the block so that we know it has been used when considering
- other basic block notes. */
- bb->aux = bb;
-
return bb;
}
--- 311,321 ----
bb->end = end;
bb->index = index;
bb->flags = BB_NEW;
+ bb->aux = NULL;
BASIC_BLOCK (index) = bb;
if (basic_block_for_insn)
update_bb_for_insn (bb);
return bb;
}
*************** create_basic_block (index, head, end)
*** 350,356 ****
}
bb = create_basic_block_structure (index, head, end, NULL);
- bb->aux = NULL;
return bb;
}
--- 347,352 ----