This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[assert] Fix genattrtab breakage
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: echristo at redhat dot com
- Date: Thu, 09 Sep 2004 16:59:37 +0100
- Subject: [assert] Fix genattrtab breakage
- Organization: Codesourcery LLC
I've committed this patch which fixes up some missing pieces of
assertification that I've accumulated. It also fixes a genattrtab
typo that caused mips64 to die (and probably others).
built and tested on i686-pc-linux-gnu -- except the genattrtab
change, which I merely built.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2004-09-08 Nathan Sidwell <nathan@codesourcery.com>
* cgraphunit.c (cgraph_mark_functions_to_output): Renable node
dumping for development builds.
* emit-rtl.c (verify_rtx_sharing): Give verbose failure for
development builds only.
* genattrtab.c (write_eligible_delay): Fix typo in previous
commit.
* tree.c (iterative_hash_expr): Replace gcc_unreachable with
gcc_assert.
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.76
diff -c -3 -p -r1.76 cgraphunit.c
*** cgraphunit.c 8 Sep 2004 09:28:06 -0000 1.76
--- cgraphunit.c 9 Sep 2004 15:49:43 -0000
*************** cgraph_mark_functions_to_output (void)
*** 776,784 ****
&& !DECL_EXTERNAL (decl))
node->output = 1;
else
! /* We should've reclaimed all functions that are not needed. */
! gcc_assert (node->global.inlined_to || !DECL_SAVED_TREE (decl)
! || DECL_EXTERNAL (decl));
}
}
--- 776,796 ----
&& !DECL_EXTERNAL (decl))
node->output = 1;
else
! {
! /* We should've reclaimed all functions that are not needed. */
! #ifdef ENABLE_CHECKING
! if (!node->global.inlined_to && DECL_SAVED_TREE (decl)
! && !DECL_EXTERNAL (decl))
! {
! dump_cgraph_node (stderr, node);
! internal_error ("failed to reclaim unneeded function");
! }
! #endif
! gcc_assert (node->global.inlined_to || !DECL_SAVED_TREE (decl)
! || DECL_EXTERNAL (decl));
!
! }
!
}
}
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.412
diff -c -3 -p -r1.412 emit-rtl.c
*** emit-rtl.c 8 Sep 2004 08:05:09 -0000 1.412
--- emit-rtl.c 9 Sep 2004 15:49:53 -0000
*************** verify_rtx_sharing (rtx orig, rtx insn)
*** 2260,2274 ****
/* This rtx may not be shared. If it has already been seen,
replace it with a copy of itself. */
!
if (RTX_FLAG (x, used))
{
error ("Invalid rtl sharing found in the insn");
debug_rtx (insn);
error ("Shared rtx");
debug_rtx (x);
! fatal_error ("Internal consistency failure");
}
RTX_FLAG (x, used) = 1;
/* Now scan the subexpressions recursively. */
--- 2260,2277 ----
/* This rtx may not be shared. If it has already been seen,
replace it with a copy of itself. */
! #ifdef ENABLE_CHECKING
if (RTX_FLAG (x, used))
{
error ("Invalid rtl sharing found in the insn");
debug_rtx (insn);
error ("Shared rtx");
debug_rtx (x);
! internal_error ("Internal consistency failure");
}
+ #endif
+ gcc_assert (!RTX_FLAG (x, used));
+
RTX_FLAG (x, used) = 1;
/* Now scan the subexpressions recursively. */
*************** verify_rtx_sharing (rtx orig, rtx insn)
*** 2291,2299 ****
for (j = 0; j < len; j++)
{
! /* We allow sharing of ASM_OPERANDS inside single instruction. */
if (j && GET_CODE (XVECEXP (x, i, j)) == SET
! && GET_CODE (SET_SRC (XVECEXP (x, i, j))) == ASM_OPERANDS)
verify_rtx_sharing (SET_DEST (XVECEXP (x, i, j)), insn);
else
verify_rtx_sharing (XVECEXP (x, i, j), insn);
--- 2294,2304 ----
for (j = 0; j < len; j++)
{
! /* We allow sharing of ASM_OPERANDS inside single
! instruction. */
if (j && GET_CODE (XVECEXP (x, i, j)) == SET
! && (GET_CODE (SET_SRC (XVECEXP (x, i, j)))
! == ASM_OPERANDS))
verify_rtx_sharing (SET_DEST (XVECEXP (x, i, j)), insn);
else
verify_rtx_sharing (XVECEXP (x, i, j), insn);
Index: genattrtab.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genattrtab.c,v
retrieving revision 1.152
diff -c -3 -p -r1.152 genattrtab.c
*** genattrtab.c 9 Sep 2004 13:22:32 -0000 1.152
--- genattrtab.c 9 Sep 2004 15:50:01 -0000
*************** write_eligible_delay (const char *kind)
*** 4125,4131 ****
printf ("{\n");
printf (" rtx insn;\n");
printf ("\n");
! printf (" gcc_assert (slot < %d)\n", max_slots);
printf ("\n");
/* Allow dbr_schedule to pass labels, etc. This can happen if try_split
converts a compound instruction into a loop. */
--- 4125,4131 ----
printf ("{\n");
printf (" rtx insn;\n");
printf ("\n");
! printf (" gcc_assert (slot < %d);\n", max_slots);
printf ("\n");
/* Allow dbr_schedule to pass labels, etc. This can happen if try_split
converts a compound instruction into a loop. */
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.424
diff -c -3 -p -r1.424 tree.c
*** tree.c 9 Sep 2004 07:54:06 -0000 1.424
--- tree.c 9 Sep 2004 15:50:15 -0000
*************** iterative_hash_expr (tree t, hashval_t v
*** 4044,4051 ****
/* Decls we can just compare by pointer. */
val = iterative_hash_pointer (t, val);
}
! else if (IS_EXPR_CODE_CLASS (class))
{
val = iterative_hash_object (code, val);
/* Don't hash the type, that can lead to having nodes which
--- 4044,4053 ----
/* Decls we can just compare by pointer. */
val = iterative_hash_pointer (t, val);
}
! else
{
+ gcc_assert (IS_EXPR_CODE_CLASS (class));
+
val = iterative_hash_object (code, val);
/* Don't hash the type, that can lead to having nodes which
*************** iterative_hash_expr (tree t, hashval_t v
*** 4080,4087 ****
for (i = first_rtl_op (code) - 1; i >= 0; --i)
val = iterative_hash_expr (TREE_OPERAND (t, i), val);
}
- else
- gcc_unreachable ();
return val;
break;
}
--- 4082,4087 ----