summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-26 09:55:30 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-26 09:55:30 +0000
commit1fdf9a6c12ff5e5a1feaf7111901021a66ad40e7 (patch)
tree5b8e8a5315c9686f63ea2da022b4eaeb2c40ea42 /gcc/tree-ssa.c
parentf0e4d727c2340ef277008933585492d963da6860 (diff)
downloadgcc-1fdf9a6c12ff5e5a1feaf7111901021a66ad40e7.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143673 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 935cad676c1..91cbc195001 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1731,7 +1731,12 @@ execute_update_addresses_taken (void)
|| bitmap_bit_p (addresses_taken, DECL_UID (var)))
continue;
- if (TREE_ADDRESSABLE (var))
+ if (TREE_ADDRESSABLE (var)
+ /* Do not change TREE_ADDRESSABLE if we need to preserve var as
+ a non-register. Otherwise we are confused and forget to
+ add virtual operands for it. */
+ && (!is_gimple_reg_type (TREE_TYPE (var))
+ || !bitmap_bit_p (not_reg_needs, DECL_UID (var))))
{
TREE_ADDRESSABLE (var) = 0;
if (is_gimple_reg (var))