summaryrefslogtreecommitdiff
path: root/gcc/gimple-streamer-out.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-13 11:58:12 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-13 11:58:12 +0000
commitce016e273825134bee8e22c8cbc1cef79e01b009 (patch)
tree2607d28f3c7bdd021c6aea3fa2f50204b08590b4 /gcc/gimple-streamer-out.c
parent26fc128eab91ae40894877a81973aeef3ef71fae (diff)
downloadgcc-ce016e273825134bee8e22c8cbc1cef79e01b009.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204740 138bc75d-0d04-0410-961f-82ee72b054a4
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 976f57ecef4..e7430a68234 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