This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[LTO] patch to fix compilation failure of 20000804-1.c
- From: "=?big5?b?RG91ZyBLd2FuICjD9q62vHcp?=" <dougkwan at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: "Diego Novillo" <dnovillo at google dot com>
- Date: Fri, 2 Nov 2007 15:58:24 -0700
- Subject: [LTO] patch to fix compilation failure of 20000804-1.c
Hi
Could somone review and approve this? This fixes an ICE in the
LTO branch while compiling test case
gcc.c-torture/compile/20000804-1.c. Thanks.
-Doug
----------------------------------------------
2007-11-02 Doug Kwan <dougkwan@google.com>
* lto-function-out.c (output_record_start): Check for presence of
type before calling output_type_ref. String constants may not
have types.
-------------
Index: lto-function-out.c
===================================================================
--- lto-function-out.c (revision 129844)
+++ lto-function-out.c (working copy)
@@ -990,7 +990,10 @@
if (expr)
{
enum tree_code code = TREE_CODE (expr);
- if (value && TEST_BIT (lto_types_needed_for, code))
+ /* String constants may not have types. */
+ if (value &&
+ TREE_TYPE (value) &&
+ TEST_BIT (lto_types_needed_for, code))
output_type_ref (ob, TREE_TYPE (value));
output_tree_flags (ob, code, expr, false);
}