aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-01-26 09:55:30 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-01-26 09:55:30 +0000
commite3e6cff41e9d63815a0396e02ee17d0a1261fccd (patch)
tree5b8e8a5315c9686f63ea2da022b4eaeb2c40ea42 /gcc/tree-ssa-alias.c
parentdc874b53e5529e2a76d610500345e1f469366346 (diff)
downloadgcc-e3e6cff41e9d63815a0396e02ee17d0a1261fccd.zip
gcc-e3e6cff41e9d63815a0396e02ee17d0a1261fccd.tar.gz
gcc-e3e6cff41e9d63815a0396e02ee17d0a1261fccd.tar.bz2
re PR tree-optimization/38745 (ICE: statement makes a memory store, but has no VDEFS)
2009-01-26 Richard Guenther <rguenther@suse.de> PR tree-optimization/38745 * tree-ssa.c (execute_update_addresses_taken): Do not include variables that cannot possibly be a register in not_reg_needs. Do not clear TREE_ADDRESSABLE on vars that may not become registers. * tree-ssa.c (update_alias_info_1): Include those in the set of addressable vars. * g++.dg/torture/pr38745.C: New testcase. From-SVN: r143673
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 4e9d28b..9ed242d 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -2483,6 +2483,22 @@ update_alias_info_1 (gimple stmt, struct alias_info *ai)
if (addr_taken)
bitmap_ior_into (gimple_addressable_vars (cfun), addr_taken);
+ /* If we have a call or an assignment, see if the lhs contains
+ a local decl that requires not to be a gimple register. */
+ if (gimple_code (stmt) == GIMPLE_ASSIGN
+ || gimple_code (stmt) == GIMPLE_CALL)
+ {
+ tree lhs = gimple_get_lhs (stmt);
+ /* A plain decl does not need it set. */
+ if (lhs && handled_component_p (lhs))
+ {
+ tree var = get_base_address (lhs);
+ if (DECL_P (var)
+ && is_gimple_reg_type (TREE_TYPE (var)))
+ bitmap_set_bit (gimple_addressable_vars (cfun), DECL_UID (var));
+ }
+ }
+
/* Process each operand use. For pointers, determine whether they
are dereferenced by the statement, or whether their value
escapes, etc. */