aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-streamer-out.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-11-13 11:58:12 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-11-13 11:58:12 +0000
commit3fede97959b8658c34c3a77164dd570f0e79b63d (patch)
tree2607d28f3c7bdd021c6aea3fa2f50204b08590b4 /gcc/gimple-streamer-out.c
parentb0d04a5f56c5b7b83a7c00341027fa8b56b74f99 (diff)
downloadgcc-3fede97959b8658c34c3a77164dd570f0e79b63d.zip
gcc-3fede97959b8658c34c3a77164dd570f0e79b63d.tar.gz
gcc-3fede97959b8658c34c3a77164dd570f0e79b63d.tar.bz2
gimple-streamer-out.c (output_gimple_stmt): Also wrap decls in ADDR_EXPR operands inside a MEM_REF and optimize that.
2013-11-13 Richard Biener <rguenther@suse.de> * gimple-streamer-out.c (output_gimple_stmt): Also wrap decls in ADDR_EXPR operands inside a MEM_REF and optimize that. * gimple-streamer-in.c (input_gimple_stmt): Remove now dead code dealing with type mismatches inside component reference chains. From-SVN: r204740
Diffstat (limited to 'gcc/gimple-streamer-out.c')
-rw-r--r--gcc/gimple-streamer-out.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/gimple-streamer-out.c b/gcc/gimple-streamer-out.c
index 976f57e..e7430a6 100644
--- a/gcc/gimple-streamer-out.c
+++ b/gcc/gimple-streamer-out.c
@@ -129,6 +129,8 @@ output_gimple_stmt (struct output_block *ob, gimple stmt)
if (op && (i || !is_gimple_debug (stmt)))
{
basep = &op;
+ if (TREE_CODE (*basep) == ADDR_EXPR)
+ basep = &TREE_OPERAND (*basep, 0);
while (handled_component_p (*basep))
basep = &TREE_OPERAND (*basep, 0);
if (TREE_CODE (*basep) == VAR_DECL
@@ -136,10 +138,10 @@ output_gimple_stmt (struct output_block *ob, gimple stmt)
&& !DECL_REGISTER (*basep))
{
bool volatilep = TREE_THIS_VOLATILE (*basep);
+ tree ptrtype = build_pointer_type (TREE_TYPE (*basep));
*basep = build2 (MEM_REF, TREE_TYPE (*basep),
- build_fold_addr_expr (*basep),
- build_int_cst (build_pointer_type
- (TREE_TYPE (*basep)), 0));
+ build1 (ADDR_EXPR, ptrtype, *basep),
+ build_int_cst (ptrtype, 0));
TREE_THIS_VOLATILE (*basep) = volatilep;
}
else