aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-07-14 16:29:22 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-07-14 16:29:22 +0000
commit61593e5e75091d5bc53c16a42c791a32014f74eb (patch)
tree715579bf52abde6a4c4d6aa16b7edf3a21562657 /gcc/lto-streamer-out.c
parentfc7fcda12bd16c2c7515d9d1d1350c3547916e5c (diff)
downloadgcc-61593e5e75091d5bc53c16a42c791a32014f74eb.zip
gcc-61593e5e75091d5bc53c16a42c791a32014f74eb.tar.gz
gcc-61593e5e75091d5bc53c16a42c791a32014f74eb.tar.bz2
lto-streamer-in.c (maybe_fixup_handled_component): Remove.
2010-07-14 Richard Guenther <rguenther@suse.de> * lto-streamer-in.c (maybe_fixup_handled_component): Remove. (maybe_fixup_decls): Likewise. (input_gimple_stmt): Do not fixup anything. * lto-streamer-out.c (output_gimple_stmt): Make sure all non-automatic variable uses are wrapped inside a MEM_REF. From-SVN: r162185
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index db9ce4b..7b78ce5 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1706,6 +1706,25 @@ output_gimple_stmt (struct output_block *ob, gimple stmt)
for (i = 0; i < gimple_num_ops (stmt); i++)
{
tree op = gimple_op (stmt, i);
+ /* 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. */
+ if (op)
+ {
+ tree *basep = &op;
+ if (handled_component_p (*basep))
+ basep = &TREE_OPERAND (*basep, 0);
+ if (TREE_CODE (*basep) == VAR_DECL
+ && !auto_var_in_fn_p (*basep, current_function_decl))
+ {
+ bool volatilep = TREE_THIS_VOLATILE (*basep);
+ *basep = build2 (MEM_REF, TREE_TYPE (*basep),
+ build_fold_addr_expr (*basep),
+ build_int_cst (build_pointer_type
+ (TREE_TYPE (*basep)), 0));
+ TREE_THIS_VOLATILE (*basep) = volatilep;
+ }
+ }
lto_output_tree_ref (ob, op);
}
break;