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]

Re: [lto][patch] Patch to fix multiple C++ streaming issues and a residual problem with preload_common_nodes


Here is a revised patch.  I fixed up some other instances of extra
spaces before array subscripts in lto-function-in.c, so the patch is a
bit bigger.  The most interesting change is the following;

Index: gcc/opts.c
===================================================================
--- gcc/opts.c	(revision 138538)
+++ gcc/opts.c	(working copy)
@@ -1079,6 +1079,12 @@ decode_options (unsigned int argc, const
 	flag_really_no_inline = flag_no_inline;
     }

+  /* FIXME lto: With -flto, debug information will be incomplete or
+     inaccurate, or worse, may be sufficiently corrupt as to crash the
+     debug info writer.  */
+  if (flag_generate_lto && debug_info_level != DINFO_LEVEL_NONE)
+    inform ("-g is presently unsupported with -flto");
+
   /* Set flag_no_inline before the post_options () hook.  The C front
      ends use it to determine tree inlining defaults.  FIXME: such
      code should be lang-independent when all front ends use tree
@@ -1969,14 +1975,6 @@ common_handle_option (size_t scode, cons
       flag_unroll_loops_set = true;
       break;

-    case OPT_flto:
-      /* FIXME: This is most surely the wrong thing to do because it
-	 will depend on the order of the options on the command line.
-	 However, if you specify -flto, you must have dwarf2 debugging
-	 records.  */
-      set_debug_level (DWARF2_DEBUG, false, "2");
-      break;
-
     case OPT_g:
       set_debug_level (NO_DEBUG, DEFAULT_GDB_EXTENSIONS, arg);
       break;

I followed the existing convention for option warnings, rather than modifying
set_debug_level to assure that there would be no option-order dependency
issues.

Also, in reset_type_lang_specfic:

+  if (TREE_CODE (decl) == TYPE_DECL)
+    {
+      /* According to tree.h, the DECL_INITIAL field isn't
+	 used for TYPE_DECLs, but in C++, I've seen a TREE_LIST
+	 here full of language-specific stuff.  Omit it.  */
+      DECL_INITIAL (decl) = NULL_TREE;
+    }

And in output_type_decl:

+  /* We expect free_lang_specifics to clear the INITIAL field.  */
+  gcc_assert (decl->decl_common.initial == NULL_TREE);


--Bill

Attachment: streamer-c++-patch-08-01.txt
Description: Text document


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