This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Make discover_nonconstant_array_refs only handle non-BLKmode arrays
- From: Andrey Belevantsev <abel at ispras dot ru>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 03 Jun 2009 18:03:36 +0400
- Subject: [PATCH] Make discover_nonconstant_array_refs only handle non-BLKmode arrays
Hello,
While discussing alias-export patch with Richard, he suggested that the
code in discover_nonconstant_array_refs_r should not touch BLKmode
arrays, as they do not apply to the comment from
discover_nonconstant_array_refs. The patch doing this bootstraps and
tests on x86-64 with all default languages and Ada. Ok for trunk?
Andrey
2009-06-03 Richard Guenther <rguenther@suse.de>
Andrey Belevantsev <abel@ispras.ru>
* cfgexpand.c (discover_nonconstant_array_refs_r): Make only
non-BLKmode arrays addressable.
Index: gcc/cfgexpand.c
===================================================================
*** gcc/cfgexpand.c (revision 148120)
--- gcc/cfgexpand.c (working copy)
*************** discover_nonconstant_array_refs_r (tree
*** 2321,2327 ****
if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
{
t = get_base_address (t);
! if (t && DECL_P (t))
TREE_ADDRESSABLE (t) = 1;
}
--- 2321,2328 ----
if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
{
t = get_base_address (t);
! if (t && DECL_P (t)
! && DECL_MODE (t) != BLKmode)
TREE_ADDRESSABLE (t) = 1;
}