This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]