This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: fix ICE while producing libgcc/_muldi3.o
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 30 Jan 2007 20:03:45 -0500
- Subject: PATCH: fix ICE while producing libgcc/_muldi3.o
Mainline gcc configured with --enable-checking=all has been failing lately with
an ICE in fold_checksum_tree while trying to produce libgcc/_muldi3.o. I
tracked it down to a reference to TREE_TYPE on a GIMPLE_MODIFY_STMT object,
which does not have a type field. Here's a patch to fix this by making
fold_checksum_tree skip over tcc_gimple_stmt expressions. Is this the Right
Thing To Do, or is the bug that an expression containing a GIMPLE_MODIFY_STMT is
making it to the constant-folding code in the first place?
-Sandra
2007-01-30 Sandra Loosemore <sandra@codesourcery.com>
* fold-const.c (fold_checksum_tree): Avoid referencing nonexistent
TREE_TYPE field of GIMPLE_MODIFY_STMT objects.
Index: fold-const.c
===================================================================
--- fold-const.c (revision 121332)
+++ fold-const.c (working copy)
@@ -12097,6 +12097,9 @@
TYPE_CACHED_VALUES (expr) = NULL;
}
}
+ else if (TREE_CODE_CLASS (code) == tcc_gimple_stmt)
+ /* Skip expressions without type information. */
+ return;
md5_process_bytes (expr, tree_size (expr), ctx);
fold_checksum_tree (TREE_TYPE (expr), ctx, ht);
if (TREE_CODE_CLASS (code) != tcc_type