This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Enable test in identify_blocks
- To: gcc-patches at gcc dot gnu dot org
- Subject: Enable test in identify_blocks
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Sat, 24 Feb 01 08:20:07 EST
There was a disabled validity test which didn't take too much work to
get working, so I enabled it. Tested on alphaev56.
Sat Feb 24 06:45:21 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* tree.h (BLOCK_DEAD): New macro.
(struct tree_block): New flag, dead_flag.
* print-tree.c (print_node, case 'b'): Print missing fields.
* emit-rtl.c (remove_unnecessary_notes): Set BLOCK_DEAD.
* function.c (identify_blocks): Enable test for misplaced notes.
(all_blocks): Skip BLOCK_DEAD blocks.
* integrate.c (integrate_decl_tree): Likewise.
*** emit-rtl.c 2001/02/13 20:17:44 1.163
--- emit-rtl.c 2001/02/24 12:39:00
*************** remove_unnecessary_notes ()
*** 2882,2885 ****
--- 2882,2886 ----
if (debug_ignore_block (NOTE_BLOCK (insn)))
{
+ BLOCK_DEAD (NOTE_BLOCK (insn)) = 1;
remove_insn (prev);
remove_insn (insn);
*** function.c 2001/02/24 02:22:07 1.252
--- function.c 2001/02/24 12:39:15
*************** identify_blocks ()
*** 5741,5746 ****
/* If we didn't use all of the subblocks, we've misplaced block notes. */
! /* ??? This appears to happen all the time. Latent bugs elsewhere? */
! if (0 && last_block_vector != block_vector + n_blocks)
abort ();
--- 5741,5745 ----
/* If we didn't use all of the subblocks, we've misplaced block notes. */
! if (last_block_vector != block_vector + n_blocks)
abort ();
*************** blocks_nreverse (t)
*** 5948,5972 ****
static int
! all_blocks (block, vector)
! tree block;
tree *vector;
{
int n_blocks = 0;
! while (block)
! {
! TREE_ASM_WRITTEN (block) = 0;
!
! /* Record this block. */
! if (vector)
! vector[n_blocks] = block;
!
! ++n_blocks;
!
! /* Record the subblocks, and their subblocks... */
! n_blocks += all_blocks (BLOCK_SUBBLOCKS (block),
! vector ? vector + n_blocks : 0);
! block = BLOCK_CHAIN (block);
! }
return n_blocks;
--- 5947,5972 ----
static int
! all_blocks (blocks, vector)
! tree blocks;
tree *vector;
{
int n_blocks = 0;
+ tree block;
! for (block = blocks; block != 0; block = TREE_CHAIN (block))
! if (!BLOCK_DEAD (block))
! {
! TREE_ASM_WRITTEN (block) = 0;
!
! /* Record this block. */
! if (vector)
! vector[n_blocks] = block;
!
! ++n_blocks;
!
! /* Record the subblocks, and their subblocks... */
! n_blocks += all_blocks (BLOCK_SUBBLOCKS (block),
! vector ? vector + n_blocks : 0);
! }
return n_blocks;
*** integrate.c 2001/02/21 14:42:10 1.129
--- integrate.c 2001/02/24 12:39:24
*************** integrate_decl_tree (let, map)
*** 1685,1693 ****
next = &BLOCK_SUBBLOCKS (new_block);
for (t = BLOCK_SUBBLOCKS (let); t; t = BLOCK_CHAIN (t))
! {
! *next = integrate_decl_tree (t, map);
! BLOCK_SUPERCONTEXT (*next) = new_block;
! next = &BLOCK_CHAIN (*next);
! }
TREE_USED (new_block) = TREE_USED (let);
--- 1685,1694 ----
next = &BLOCK_SUBBLOCKS (new_block);
for (t = BLOCK_SUBBLOCKS (let); t; t = BLOCK_CHAIN (t))
! if (!BLOCK_DEAD (t))
! {
! *next = integrate_decl_tree (t, map);
! BLOCK_SUPERCONTEXT (*next) = new_block;
! next = &BLOCK_CHAIN (*next);
! }
TREE_USED (new_block) = TREE_USED (let);
*** print-tree.c 2001/02/18 06:03:09 1.40
--- print-tree.c 2001/02/24 12:39:26
*************** print_node (file, prefix, node, indent)
*** 585,588 ****
--- 585,596 ----
case 'b':
+ if (BLOCK_ABSTRACT (node))
+ fprintf (file, " abstract");
+ if (BLOCK_HANDLER_BLOCK (node))
+ fprintf (file, " handler-block");
+ if (BLOCK_DEAD (node))
+ fprintf (file, " dead");
+ fprintf (file, " block-number %d", BLOCK_NUMBER (node));
+
print_node (file, "vars", BLOCK_VARS (node), indent + 4);
print_node (file, "supercontext", BLOCK_SUPERCONTEXT (node), indent + 4);
*** tree.h 2001/02/21 14:42:09 1.226
--- tree.h 2001/02/24 12:39:33
*************** struct tree_exp
*** 830,833 ****
--- 830,837 ----
#define BLOCK_HANDLER_BLOCK(NODE) (BLOCK_CHECK (NODE)->block.handler_block_flag)
+ /* Nonzero means the block was deleted as dead and should not be copied
+ when a function is inlined. */
+ #define BLOCK_DEAD(NODE) (BLOCK_CHECK (NODE)->block.dead_flag)
+
/* An index number for this block. These values are not guaranteed to
be unique across functions -- whether or not they are depends on
*************** struct tree_block
*** 841,845 ****
unsigned handler_block_flag : 1;
unsigned abstract_flag : 1;
! unsigned block_num : 30;
union tree_node *vars;
--- 845,850 ----
unsigned handler_block_flag : 1;
unsigned abstract_flag : 1;
! unsigned dead_flag : 1;
! unsigned block_num : 29;
union tree_node *vars;