From ba4876390b4cb6b94e4ee64d6646fee7aa43b556 Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 9 Nov 2010 19:31:45 +0000 Subject: PR target/43808 * cfgexpand.c (partition_stack_vars): Call update_alias_info_with_stack_vars unconditionally. (update_alias_info_with_stack_vars): Allow unused unreferenced vars when not optimizing. * gfortran.dg/pr43808.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166509 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cfgexpand.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gcc/cfgexpand.c') diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index c44649e857d..784639d9e65 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -516,9 +516,11 @@ update_alias_info_with_stack_vars (void) unsigned int uid = DECL_PT_UID (decl); /* We should never end up partitioning SSA names (though they may end up on the stack). Neither should we allocate stack - space to something that is unused and thus unreferenced. */ + space to something that is unused and thus unreferenced, except + for -O0 where we are preserving even unreferenced variables. */ gcc_assert (DECL_P (decl) - && referenced_var_lookup (DECL_UID (decl))); + && (!optimize + || referenced_var_lookup (DECL_UID (decl)))); bitmap_set_bit (part, uid); *((bitmap *) pointer_map_insert (decls_to_partitions, (void *)(size_t) uid)) = part; @@ -684,8 +686,7 @@ partition_stack_vars (void) } } - if (optimize) - update_alias_info_with_stack_vars (); + update_alias_info_with_stack_vars (); } /* A debugging aid for expand_used_vars. Dump the generated partitions. */ -- cgit v1.2.1