diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2011-01-08 09:38:13 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2011-01-08 09:38:13 +0000 |
commit | ecb3baaa8e973e3963eee7929bfd2fc419a2a950 (patch) | |
tree | bc81017a641e2c952741cf0d7f440a5956a9f883 /gcc/fortran/symbol.c | |
parent | 72e961c86a4da21028ac032ae03d7158af69a1af (diff) | |
download | gcc-ecb3baaa8e973e3963eee7929bfd2fc419a2a950.zip gcc-ecb3baaa8e973e3963eee7929bfd2fc419a2a950.tar.gz gcc-ecb3baaa8e973e3963eee7929bfd2fc419a2a950.tar.bz2 |
re PR fortran/45777 (Alias analysis broken for arrays where LHS or RHS is a component ref)
2011-01-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45777
* symbol.c (gfc_symbols_could_alias): Strip gfc_ prefix,
make static and move in front of its only caller, to ...
* trans-array.c (symbols_could_alias): ... here.
Pass information about pointer and target status as
arguments. Allocatable arrays don't alias anything
unless they have the POINTER attribute.
(gfc_could_be_alias): Keep track of pointer and target
status when following references. Also check if typespecs
of components match those of other components or symbols.
2011-01-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45777
* gfortran.dg/dependency_39.f90: New test.
From-SVN: r168596
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 998eac9..1a385b5 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -2813,41 +2813,6 @@ gfc_get_ha_symbol (const char *name, gfc_symbol **result) return i; } -/* Return true if both symbols could refer to the same data object. Does - not take account of aliasing due to equivalence statements. */ - -int -gfc_symbols_could_alias (gfc_symbol *lsym, gfc_symbol *rsym) -{ - /* Aliasing isn't possible if the symbols have different base types. */ - if (gfc_compare_types (&lsym->ts, &rsym->ts) == 0) - return 0; - - /* Pointers can point to other pointers, target objects and allocatable - objects. Two allocatable objects cannot share the same storage. */ - if (lsym->attr.pointer - && (rsym->attr.pointer || rsym->attr.allocatable || rsym->attr.target)) - return 1; - if (lsym->attr.target && rsym->attr.pointer) - return 1; - if (lsym->attr.allocatable && rsym->attr.pointer) - return 1; - - /* Special case: Argument association, cf. F90 12.4.1.6, F2003 12.4.1.7 - and F2008 12.5.2.13 items 3b and 4b. The pointer case (a) is already - checked above. */ - if (lsym->attr.target && rsym->attr.target - && ((lsym->attr.dummy && !lsym->attr.contiguous - && (!lsym->attr.dimension || lsym->as->type == AS_ASSUMED_SHAPE)) - || (rsym->attr.dummy && !rsym->attr.contiguous - && (!rsym->attr.dimension - || rsym->as->type == AS_ASSUMED_SHAPE)))) - return 1; - - return 0; -} - - /* Undoes all the changes made to symbols in the current statement. This subroutine is made simpler due to the fact that attributes are never removed once added. */ |