aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-12-15 16:30:22 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-12-15 16:30:22 +0000
commit2a71eb48e4348f8bc33f9b02e45fd69adbe66b9c (patch)
treeb88b0549fc1a571763835c3ca441355bf819abe1
parent9f81eaccf9ab5a38f9a988ccc63a3299e18ef5b5 (diff)
downloadgcc-2a71eb48e4348f8bc33f9b02e45fd69adbe66b9c.zip
gcc-2a71eb48e4348f8bc33f9b02e45fd69adbe66b9c.tar.gz
gcc-2a71eb48e4348f8bc33f9b02e45fd69adbe66b9c.tar.bz2
tree.c (free_lang_data_in_binfo): Do not free BINFO_OFFSET and BINFO_VPTR_FIELD.
2009-12-15 Richard Guenther <rguenther@suse.de> * tree.c (free_lang_data_in_binfo): Do not free BINFO_OFFSET and BINFO_VPTR_FIELD. (free_lang_data_in_type): Do not free TYPE_STUB_DECL if we generate debug information. (free_lang_data_in_decl): Do not free DECL_SIZE_UNIT, DECL_SIZE, DECL_FIELD_OFFSET and DECL_FCONTEXT. (free_lang_data): Do not disable debuginfo. * lto-streamer-out.c (write_symbol_vec): Deal with non-constant DECL_SIZE. (pack_ts_base_value_fields): Write types with false TREE_ASM_WRITTEN. (lto_output_ts_type_tree_pointers): Stream TYPE_STUB_DECL. * lto-streamer-in.c (lto_input_ts_type_tree_pointers): Stream TYPE_STUB_DECL. * dwarf2out.c (add_pure_or_virtual_attribute): Check for DECL_CONTEXT. (gen_type_die_for_member): Test for TYPE_STUB_DECL. * opts.c (decode_options): Do not disable var-tracking for lto. * doc/invoke.texi (-flto): Document -flto vs. -g experimental status. (-fwhopr): Document experimental status. lto/ * lto.c (lto_fixup_field_decl): Fixup DECL_FIELD_OFFSET. (lto_post_options): Do not disable debuginfo. From-SVN: r155259
-rw-r--r--gcc/ChangeLog24
-rw-r--r--gcc/doc/invoke.texi6
-rw-r--r--gcc/dwarf2out.c6
-rw-r--r--gcc/lto-streamer-in.c1
-rw-r--r--gcc/lto-streamer-out.c8
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto-lang.c10
-rw-r--r--gcc/lto/lto.c2
-rw-r--r--gcc/opts.c4
-rw-r--r--gcc/tree.c42
10 files changed, 57 insertions, 51 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6259415..b205823 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,27 @@
+2009-12-15 Richard Guenther <rguenther@suse.de>
+
+ * tree.c (free_lang_data_in_binfo): Do not free BINFO_OFFSET
+ and BINFO_VPTR_FIELD.
+ (free_lang_data_in_type): Do not free TYPE_STUB_DECL if we
+ generate debug information.
+ (free_lang_data_in_decl): Do not free DECL_SIZE_UNIT,
+ DECL_SIZE, DECL_FIELD_OFFSET and DECL_FCONTEXT.
+ (free_lang_data): Do not disable debuginfo.
+ * lto-streamer-out.c (write_symbol_vec): Deal with
+ non-constant DECL_SIZE.
+ (pack_ts_base_value_fields): Write types with false
+ TREE_ASM_WRITTEN.
+ (lto_output_ts_type_tree_pointers): Stream TYPE_STUB_DECL.
+ * lto-streamer-in.c (lto_input_ts_type_tree_pointers): Stream
+ TYPE_STUB_DECL.
+ * dwarf2out.c (add_pure_or_virtual_attribute): Check for
+ DECL_CONTEXT.
+ (gen_type_die_for_member): Test for TYPE_STUB_DECL.
+ * opts.c (decode_options): Do not disable var-tracking for lto.
+ * doc/invoke.texi (-flto): Document -flto vs. -g experimental
+ status.
+ (-fwhopr): Document experimental status.
+
2009-12-15 Aldy Hernandez <aldyh@redhat.com>
PR graphite/42185
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 3a48494..b548d0c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -7321,6 +7321,10 @@ types of hosts. The bytecode files are versioned and there is a
strict version check, so bytecode files generated in one version of
GCC will not work with an older/newer version of GCC.
+Link time optimization does not play well with generating debugging
+information. Combining @option{-flto} or @option{-fwhopr} with
+@option{-g} is experimental.
+
This option is disabled by default.
@item -fwhopr
@@ -7337,6 +7341,8 @@ that otherwise would not fit in memory. This option enables
Disabled by default.
+This option is experimental.
+
@item -fwpa
@opindex fwpa
This is an internal option used by GCC when compiling with
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index b3aa5a5..c366ee5 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -16473,7 +16473,8 @@ add_pure_or_virtual_attribute (dw_die_ref die, tree func_decl)
0));
/* GNU extension: Record what type this method came from originally. */
- if (debug_info_level > DINFO_LEVEL_TERSE)
+ if (debug_info_level > DINFO_LEVEL_TERSE
+ && DECL_CONTEXT (func_decl))
add_AT_die_ref (die, DW_AT_containing_type,
lookup_type_die (DECL_CONTEXT (func_decl)));
}
@@ -17393,7 +17394,8 @@ gen_type_die_for_member (tree type, tree member, dw_die_ref context_die)
/* If we're trying to avoid duplicate debug info, we may not have
emitted the member decl for this function. Emit it now. */
- if (TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (type))
+ if (TYPE_STUB_DECL (type)
+ && TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (type))
&& ! lookup_decl_die (member))
{
dw_die_ref type_die;
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index ea657e1..c390f27 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -2162,6 +2162,7 @@ lto_input_ts_type_tree_pointers (struct lto_input_block *ib,
TYPE_BINFO (expr) = lto_input_tree (ib, data_in);
TYPE_CONTEXT (expr) = lto_input_tree (ib, data_in);
TYPE_CANONICAL (expr) = lto_input_tree (ib, data_in);
+ TYPE_STUB_DECL (expr) = lto_input_tree (ib, data_in);
}
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 920cd27..c489e42 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -342,7 +342,8 @@ pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
bp_pack_value (bp, DECL_UNSIGNED (expr), 1);
else if (TYPE_P (expr))
bp_pack_value (bp, TYPE_UNSIGNED (expr), 1);
- bp_pack_value (bp, TREE_ASM_WRITTEN (expr), 1);
+ /* We write debug info two times, do not confuse the second one. */
+ bp_pack_value (bp, TYPE_P (expr) ? 0 : TREE_ASM_WRITTEN (expr), 1);
bp_pack_value (bp, TREE_NO_WARNING (expr), 1);
bp_pack_value (bp, TREE_USED (expr), 1);
bp_pack_value (bp, TREE_NOTHROW (expr), 1);
@@ -966,6 +967,7 @@ lto_output_ts_type_tree_pointers (struct output_block *ob, tree expr,
lto_output_tree_or_ref (ob, TYPE_BINFO (expr), ref_p);
lto_output_tree_or_ref (ob, TYPE_CONTEXT (expr), ref_p);
lto_output_tree_or_ref (ob, TYPE_CANONICAL (expr), ref_p);
+ lto_output_tree_or_ref (ob, TYPE_STUB_DECL (expr), ref_p);
}
@@ -2335,7 +2337,9 @@ write_symbol_vec (struct lto_streamer_cache_d *cache,
break;
}
- if (kind == GCCPK_COMMON && DECL_SIZE (t))
+ if (kind == GCCPK_COMMON
+ && DECL_SIZE (t)
+ && TREE_CODE (DECL_SIZE (t)) == INTEGER_CST)
size = (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE (t))) << 32)
| TREE_INT_CST_LOW (DECL_SIZE (t));
else
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index f676017..04807e3 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-15 Richard Guenther <rguenther@suse.de>
+
+ * lto.c (lto_fixup_field_decl): Fixup DECL_FIELD_OFFSET.
+ (lto_post_options): Do not disable debuginfo.
+
2009-12-14 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
* Make-lang.in ($(LTO_EXE)): Use $(LINKER).
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 4c187b5..970265c 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -646,16 +646,6 @@ lto_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
static bool
lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
{
- /* FIXME lto: We have stripped enough type and other
- debugging information out of the IR that it may
- appear ill-formed to dwarf2out, etc. We must not
- attempt to generate debug info in lto1. A more
- graceful solution would disable the option flags
- rather than ignoring them, but we'd also have to
- worry about default debugging options. */
- write_symbols = NO_DEBUG;
- debug_info_level = DINFO_LEVEL_NONE;
-
/* -fltrans and -fwpa are mutually exclusive. Check for that here. */
if (flag_wpa && flag_ltrans)
error ("-fwpa and -fltrans are mutually exclusive");
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index c7ac7c3..e62bc02 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -1376,7 +1376,7 @@ static void
lto_fixup_field_decl (tree t, void *data)
{
lto_fixup_decl_common (t, data);
- gcc_assert (no_fixup_p (DECL_FIELD_OFFSET (t)));
+ LTO_FIXUP_SUBTREE (DECL_FIELD_OFFSET (t));
LTO_FIXUP_SUBTREE (DECL_BIT_FIELD_TYPE (t));
LTO_FIXUP_SUBTREE (DECL_QUALIFIER (t));
gcc_assert (no_fixup_p (DECL_FIELD_BIT_OFFSET (t)));
diff --git a/gcc/opts.c b/gcc/opts.c
index 7660bd8..5407527 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1129,10 +1129,6 @@ decode_options (unsigned int argc, const char **argv)
Otherwise, symbols will be privatized too early, causing link
errors later. */
flag_whole_program = 0;
-
- /* FIXME lto. Disable var-tracking until debug information
- is properly handled in free_lang_data. */
- flag_var_tracking = 0;
#else
error ("LTO support has not been enabled in this configuration");
#endif
diff --git a/gcc/tree.c b/gcc/tree.c
index 769b332..7fa7649 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4152,13 +4152,10 @@ free_lang_data_in_binfo (tree binfo)
gcc_assert (TREE_CODE (binfo) == TREE_BINFO);
- BINFO_OFFSET (binfo) = NULL_TREE;
BINFO_VTABLE (binfo) = NULL_TREE;
- BINFO_VPTR_FIELD (binfo) = NULL_TREE;
BINFO_BASE_ACCESSES (binfo) = NULL;
BINFO_INHERITANCE_CHAIN (binfo) = NULL_TREE;
BINFO_SUBVTT_INDEX (binfo) = NULL_TREE;
- BINFO_VPTR_FIELD (binfo) = NULL_TREE;
for (i = 0; VEC_iterate (tree, BINFO_BASE_BINFOS (binfo), i, t); i++)
free_lang_data_in_binfo (t);
@@ -4253,7 +4250,8 @@ free_lang_data_in_type (tree type)
}
TYPE_CONTEXT (type) = NULL_TREE;
- TYPE_STUB_DECL (type) = NULL_TREE;
+ if (debug_info_level < DINFO_LEVEL_TERSE)
+ TYPE_STUB_DECL (type) = NULL_TREE;
}
@@ -4380,29 +4378,16 @@ free_lang_data_in_decl (tree decl)
}
}
- if (TREE_CODE (decl) == PARM_DECL
- || TREE_CODE (decl) == FIELD_DECL
- || TREE_CODE (decl) == RESULT_DECL)
- {
- tree unit_size = DECL_SIZE_UNIT (decl);
- tree size = DECL_SIZE (decl);
- if ((unit_size && TREE_CODE (unit_size) != INTEGER_CST)
- || (size && TREE_CODE (size) != INTEGER_CST))
- {
- DECL_SIZE_UNIT (decl) = NULL_TREE;
- DECL_SIZE (decl) = NULL_TREE;
- }
+ /* ??? We could free non-constant DECL_SIZE, DECL_SIZE_UNIT
+ and DECL_FIELD_OFFSET. But it's cheap enough to not do
+ that and refrain from adding workarounds to dwarf2out.c */
- if (TREE_CODE (decl) == FIELD_DECL
- && DECL_FIELD_OFFSET (decl)
- && TREE_CODE (DECL_FIELD_OFFSET (decl)) != INTEGER_CST)
- DECL_FIELD_OFFSET (decl) = NULL_TREE;
+ /* DECL_FCONTEXT is only used for debug info generation. */
+ if (TREE_CODE (decl) == FIELD_DECL
+ && debug_info_level < DINFO_LEVEL_TERSE)
+ DECL_FCONTEXT (decl) = NULL_TREE;
- /* DECL_FCONTEXT is only used for debug info generation. */
- if (TREE_CODE (decl) == FIELD_DECL)
- DECL_FCONTEXT (decl) = NULL_TREE;
- }
- else if (TREE_CODE (decl) == FUNCTION_DECL)
+ if (TREE_CODE (decl) == FUNCTION_DECL)
{
if (gimple_has_body_p (decl))
{
@@ -4977,13 +4962,6 @@ free_lang_data (void)
diagnostic_finalizer (global_dc) = default_diagnostic_finalizer;
diagnostic_format_decoder (global_dc) = default_tree_printer;
- /* FIXME. We remove sufficient language data that the debug
- info writer gets completely confused. Disable debug information
- for now. */
- debug_info_level = DINFO_LEVEL_NONE;
- write_symbols = NO_DEBUG;
- debug_hooks = &do_nothing_debug_hooks;
-
return 0;
}