[Patch, fortran] PR42736 - [4.3/4.4/4.5 Regression] Wrong-code with allocatable or pointer components in elemental functions
Tobias Burnus
burnus@net-b.de
Tue Jan 19 23:02:00 GMT 2010
On 18.01.2010 16:08, Paul Richard Thomas wrote:
> Bootstrapped and regtested on FC9/x86_64 - OK for trunk, 4.4 and 4.3?
>
> 2010-01-18 Paul Thomas <pault@gcc.gnu.org>
>
> PR fortran/42736
> * dependency.c (possible_aliasing_types): New function.
> (possible_aliasing): New function.
> (gfc_check_dependency): Call the above to tighten up checking
> of potential aliasing with derived types.
>
> 2010-01-18 Paul Thomas <pault@gcc.gnu.org>
>
> PR fortran/42736
> * gfortran.dg/dependency_25.f90 : New test.
>
+ if (expr1->expr_type != EXPR_VARIABLE
+ || expr1->expr_type != EXPR_VARIABLE)
+ return 0;
You surely didn't want to check the same condition twice ;-)
Additionally, I wonder whether one cannot construct a test case with a
(pointer-returning) function where the dependency is not 0. (Actually, I
think the function is only called for variables - the LHS must be
assignable and the RHS needs also be a variable [switch case in caller];
if so, I would prefer an assert.)
Regarding your ts1 test, I wonder in how far one also should check for
attr.target. Currently, if expr1 is not a pointer/does not contain a
pointer component, the result of possible_aliasing is always 0; I have
the feeling that this is (potentially) wrong if expr1...->attr.target == 1.
Tobias
More information about the Fortran
mailing list