[Patch, Fortran] CAF dep (1/3): PR62278 - improve dependency.c's gfc_check_dependency's check (missed-optimization)
Tobias Burnus
burnus@net-b.de
Wed Aug 27 21:00:00 GMT 2014
The current gfc_check_dependency check always looked at the pointer
attribute - and assumed the worst, if either the LHS or the RHS was true.
Thus, it claimed that "a" and "b" alias for the following definition:
integer, pointer :: p; integer :: a. However, as "a" has no target (or
pointer) attribute, that's not possible. Additionally, "class(t) :: a"
has internally the "pointer" attribute (but
CLASS_DATA(sym)->attr.class_pointer == 0), however, in the Fortran
sense, "a" is not a pointer and cannot alias.
I do not have a good example for the test case, except for a similar one
as above using "a[i] = p" and looking at the dump; but that requires
patch 3/3 of this series.
Build and regtested on x86-64-gnu-linux. (I do get a failure for
gfortran.dg/graphite/pr42393.f90, but only with -O1 -fgraphite-identity
and also without the patch.)
OK for the trunk?
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: depend.diff
Type: text/x-patch
Size: 1648 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140827/d27c5e51/attachment.bin>
More information about the Fortran
mailing list