diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2010-06-20 23:57:54 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2010-06-20 23:57:54 +0000 |
commit | 7254364e60ef73a2e354add53b3ffb287dbb6133 (patch) | |
tree | 1f74699e3510fcfa2f6c9022caa7742fdee4fc2c | |
parent | dedd9d0500596157cd1db1957e8ed0dd3ba2ac36 (diff) | |
download | gcc-7254364e60ef73a2e354add53b3ffb287dbb6133.zip gcc-7254364e60ef73a2e354add53b3ffb287dbb6133.tar.gz gcc-7254364e60ef73a2e354add53b3ffb287dbb6133.tar.bz2 |
re PR lto/44248 (-fcompare-debug failure with -flto/-fwhopr -g)
PR debug/44248
* lto-streamer-in.c (input_bb): Leave debug stmts alone.
(input_function): Drop them here, if VTA is disabled.
From-SVN: r161056
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto-streamer-in.c | 28 |
2 files changed, 24 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b87c634..f827fab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-06-20 Alexandre Oliva <aoliva@redhat.com> + + PR debug/44248 + * lto-streamer-in.c (input_bb): Leave debug stmts alone. + (input_function): Drop them here, if VTA is disabled. + 2010-06-20 Uros Bizjak <ubizjak@gmail.com> PR target/44546 diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index e875460..635cff4 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -1204,13 +1204,6 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag, { gimple stmt = input_gimple_stmt (ib, data_in, fn, tag); - /* Change debug stmts to nops on-the-fly if we do not have VTA enabled. - This allows us to build for example static libs with debugging - enabled and do the final link without. */ - if (!MAY_HAVE_DEBUG_STMTS - && is_gimple_debug (stmt)) - stmt = gimple_build_nop (); - find_referenced_vars_in (stmt); gsi_insert_after (&bsi, stmt, GSI_NEW_STMT); @@ -1370,11 +1363,26 @@ input_function (tree fn_decl, struct data_in *data_in, stmts = (gimple *) xcalloc (gimple_stmt_max_uid (fn), sizeof (gimple)); FOR_ALL_BB (bb) { - gimple_stmt_iterator bsi; - for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi)) + gimple_stmt_iterator bsi = gsi_start_bb (bb); + while (!gsi_end_p (bsi)) { gimple stmt = gsi_stmt (bsi); - stmts[gimple_uid (stmt)] = stmt; + /* If we're recompiling LTO objects with debug stmts but + we're not supposed to have debug stmts, remove them now. + We can't remove them earlier because this would cause uid + mismatches in fixups, but we can do it at this point, as + long as debug stmts don't require fixups. */ + if (!MAY_HAVE_DEBUG_STMTS && is_gimple_debug (stmt)) + { + gimple_stmt_iterator gsi = bsi; + gsi_next (&bsi); + gsi_remove (&gsi, true); + } + else + { + gsi_next (&bsi); + stmts[gimple_uid (stmt)] = stmt; + } } } |