* 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
+2010-11-09 Jakub Jelinek <jakub@redhat.com>
+
+ 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.
+
2010-11-09 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/46036
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;
}
}
- 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. */
+2010-11-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/43808
+ * gfortran.dg/pr43808.f90: New test.
+
2010-11-09 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/46036
--- /dev/null
+! PR target/43808
+! { dg-do run }
+! { dg-options "-O0 -fipa-reference -fschedule-insns -fstrict-aliasing" }
+
+ type :: a
+ integer, allocatable :: i(:)
+ end type a
+ type :: b
+ type (a), allocatable :: j(:)
+ end type b
+ type(a) :: x(2)
+ type(b) :: y(2)
+ x(1) = a((/1,2,3,4/))
+ x(2) = a((/1,2,3,4/)+10)
+ y(1) = b((/x(1),x(2)/))
+ y(2) = b((/x(1),x(2)/))
+ if (y(1)%j(1)%i(1) .ne. 1) call abort
+end