diff options
author | Richard Biener <rguenther@suse.de> | 2013-02-13 13:31:18 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-02-13 13:31:18 +0000 |
commit | 976a81ee63d8fa4c6d7b9a8fd6f9f215cd7048e9 (patch) | |
tree | daa5e9d640693f6ab9ee02da3be5335a6bb04b19 | |
parent | 6c8064fbd1222b5e30d6ef0d1c4e087346cf37db (diff) | |
download | gcc-976a81ee63d8fa4c6d7b9a8fd6f9f215cd7048e9.zip gcc-976a81ee63d8fa4c6d7b9a8fd6f9f215cd7048e9.tar.gz gcc-976a81ee63d8fa4c6d7b9a8fd6f9f215cd7048e9.tar.bz2 |
re PR lto/56295 (Missed optimization with LTO)
2013-02-13 Richard Biener <rguenther@suse.de>
PR lto/56295
* gimple-streamer-out.c (output_gimple_stmt): Undo wrapping
globals in MEM_REFs.
From-SVN: r196013
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimple-streamer-out.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 38339d0..334f8fe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2013-02-13 Richard Biener <rguenther@suse.de> + PR lto/56295 + * gimple-streamer-out.c (output_gimple_stmt): Undo wrapping + globals in MEM_REFs. + +2013-02-13 Richard Biener <rguenther@suse.de> + * loop-init.c (loop_optimizer_init): Clear loop state when re-initializing preserved loops. * loop-unswitch.c (unswitch_single_loop): Return whether diff --git a/gcc/gimple-streamer-out.c b/gcc/gimple-streamer-out.c index 24ab0ed..adf230e 100644 --- a/gcc/gimple-streamer-out.c +++ b/gcc/gimple-streamer-out.c @@ -116,13 +116,14 @@ output_gimple_stmt (struct output_block *ob, gimple stmt) for (i = 0; i < gimple_num_ops (stmt); i++) { tree op = gimple_op (stmt, i); + tree *basep = NULL; /* Wrap all uses of non-automatic variables inside MEM_REFs so that we do not have to deal with type mismatches on merged symbols during IL read in. The first operand of GIMPLE_DEBUG must be a decl, not MEM_REF, though. */ if (op && (i || !is_gimple_debug (stmt))) { - tree *basep = &op; + basep = &op; while (handled_component_p (*basep)) basep = &TREE_OPERAND (*basep, 0); if (TREE_CODE (*basep) == VAR_DECL @@ -136,8 +137,13 @@ output_gimple_stmt (struct output_block *ob, gimple stmt) (TREE_TYPE (*basep)), 0)); TREE_THIS_VOLATILE (*basep) = volatilep; } + else + basep = NULL; } stream_write_tree (ob, op, true); + /* Restore the original base if we wrapped it inside a MEM_REF. */ + if (basep) + *basep = TREE_OPERAND (TREE_OPERAND (*basep, 0), 0); } if (is_gimple_call (stmt)) { |