[Bug fortran/38487] Bogus Warning: INTENT(INOUT) actual argument might interfere with actual argument

2009-01-14 Thread mikael at gcc dot gnu dot org


--- Comment #8 from mikael at gcc dot gnu dot org  2009-01-14 20:53 ---
Subject: Bug 38487

Author: mikael
Date: Wed Jan 14 20:53:18 2009
New Revision: 143383

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143383
Log:
2009-01-14  Mikael Morin  mikael.mo...@tele2.fr

PR fortran/35681
* ChangeLog: Fix function name.

PR fortran/38487
* dependency.c (gfc_check_argument_var_dependency):
Move the check for pointerness inside the if block
so that it doesn't affect the return value.

PR fortran/38669
* trans-stmt.c (gfc_trans_call):
Add the dependency code after the loop bounds calculation one.

2009-01-14  Mikael Morin  mikael.mo...@tele2.fr

PR fortran/38669
* gfortran.dg/elemental_dependency_3.f90: New test.
* gfortran.dg/elemental_subroutine_7.f90: New test.


Added:
   
branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/elemental_dependency_3.f90
   
branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/elemental_subroutine_7.f90
Modified:
branches/gcc-4_3-branch/gcc/fortran/ChangeLog
branches/gcc-4_3-branch/gcc/fortran/dependency.c
branches/gcc-4_3-branch/gcc/fortran/trans-stmt.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38487



[Bug fortran/38487] Bogus Warning: INTENT(INOUT) actual argument might interfere with actual argument

2009-01-04 Thread mikael at gcc dot gnu dot org


--- Comment #7 from mikael at gcc dot gnu dot org  2009-01-04 19:12 ---
Subject: Bug 38487

Author: mikael
Date: Sun Jan  4 19:12:16 2009
New Revision: 143057

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143057
Log:
2009-01-04  Mikael Morin  mikael.mo...@tele2.fr

PR fortran/35681
* ChangeLog-2008: Fix function name.

PR fortran/38487
* dependency.c (gfc_check_argument_var_dependency):
Move the check for pointerness inside the if block
so that it doesn't affect the return value.

PR fortran/38669
* trans-stmt.c (gfc_trans_call):
Add the dependency code after the loop bounds calculation one.

2009-01-04  Mikael Morin  mikael.mo...@tele2.fr

PR fortran/38669
* gfortran.dg/elemental_dependency_3.f90: New test.
* gfortran.dg/elemental_subroutine_7.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/elemental_dependency_3.f90
trunk/gcc/testsuite/gfortran.dg/elemental_subroutine_7.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/ChangeLog-2008
trunk/gcc/fortran/dependency.c
trunk/gcc/fortran/trans-stmt.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38487



[Bug fortran/38487] Bogus Warning: INTENT(INOUT) actual argument might interfere with actual argument

2008-12-21 Thread mikael at gcc dot gnu dot org


--- Comment #5 from mikael at gcc dot gnu dot org  2008-12-21 16:04 ---
Subject: Bug 38487

Author: mikael
Date: Sun Dec 21 16:03:01 2008
New Revision: 142864

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=142864
Log:
2008-12-21  Mikael Morin  mikael.mo...@tele2.fr

PR fortran/38487
* dependency.c (gfc_is_data_pointer): New function.
(gfc_check_argument_var_dependency): Disable the warning
in the pointer case.
(gfc_check_dependency): Use gfc_is_data_pointer.

2008-12-21  Mikael Morin  mikael.mo...@tele2.fr

PR fortran/38487
* gfortran.dg/elemental_dependency_2.f90: New test.


Added:
   
branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/elemental_dependency_2.f90
Modified:
branches/gcc-4_3-branch/gcc/fortran/ChangeLog
branches/gcc-4_3-branch/gcc/fortran/dependency.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38487



[Bug fortran/38487] Bogus Warning: INTENT(INOUT) actual argument might interfere with actual argument

2008-12-21 Thread mikael at gcc dot gnu dot org


--- Comment #6 from mikael at gcc dot gnu dot org  2008-12-21 16:19 ---
Fixed on trunk(4.4) and 4.3.
Thanks for the report.


-- 

mikael at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38487



[Bug fortran/38487] Bogus Warning: INTENT(INOUT) actual argument might interfere with actual argument

2008-12-15 Thread mikael at gcc dot gnu dot org


--- Comment #4 from mikael at gcc dot gnu dot org  2008-12-15 18:10 ---
Subject: Bug 38487

Author: mikael
Date: Mon Dec 15 18:08:42 2008
New Revision: 142766

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=142766
Log:
2008-12-15  Mikael Morin  mikael.mo...@tele2.fr

PR fortran/38487
* gfortran.dg/elemental_dependency_2.f90: New test.

2008-12-15  Mikael Morin  mikael.mo...@tele2.fr

PR fortran/38487
* dependency.c (gfc_is_data_pointer): New function.
(gfc_check_argument_var_dependency): Disable the warning
in the pointer case.
(gfc_check_dependency): Use gfc_is_data_pointer.


Added:
trunk/gcc/testsuite/gfortran.dg/elemental_dependency_2.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/dependency.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38487



[Bug fortran/38487] Bogus Warning: INTENT(INOUT) actual argument might interfere with actual argument

2008-12-13 Thread mikael at gcc dot gnu dot org


--- Comment #3 from mikael at gcc dot gnu dot org  2008-12-13 14:29 ---
Both the warning and the temporary creation depend on the same dependency
checking code. 
While it makes sense in the case of pointers to assume the worst (and create a
temporary, even if it's actually not needed), a warning should probably not be
emitted as it would point real problems in very few cases. 

About activating the warning with a flag (-Waliasing?), I would prefer to keep
the warning by default because it does quite a good job in non-pointer cases. 
But I don't feel very strong about it, as in my opinion, -Waliasing too should
be activated by default (are there too many false positive to do so?). 

Apart for cray pointers (see below), I don't think there are other cases where
the warning would be unwanted. 


Some random thoughts, more or less related:
- As far as I know, cray pointers are not supported by the dependency code.
- -Waliasing doesn't support elemental functions, and seems to catch full
arrays only: on elemental_dependency_1.f90, there is only one (false positive)
warning from -Waliasing. 


-- 

mikael at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2008-12-13 14:29:02
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38487



[Bug fortran/38487] Bogus Warning: INTENT(INOUT) actual argument might interfere with actual argument

2008-12-11 Thread burnus at gcc dot gnu dot org


--- Comment #1 from burnus at gcc dot gnu dot org  2008-12-11 16:07 ---
Mikael added this as part of PR 35681 with check in
http://gcc.gnu.org/viewcvs?view=revrevision=141931

See:
http://gcc.gnu.org/viewcvs/trunk/gcc/fortran/dependency.c?r1=141931r2=141930pathrev=141931

I think the warning is OK in the sense that the pointer could point to the same
memory address which could potentially make trouble, but still the warning
feels too strong. However, I have not studied neither the test case not
dependency.c in details.

Mikael, what do you think?


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||mikael at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38487



[Bug fortran/38487] Bogus Warning: INTENT(INOUT) actual argument might interfere with actual argument

2008-12-11 Thread anlauf at gmx dot de


--- Comment #2 from anlauf at gmx dot de  2008-12-11 22:25 ---
(In reply to comment #1)
 I think the warning is OK in the sense that the pointer could point to the 
 same
 memory address which could potentially make trouble, but still the warning
 feels too strong.

I don't mind a warning which is emitted with -Wall, but
there is too much noise with standard compilation flags,
given that the trouble you mention is just potential, but
need not be real.

Note that with standard F95 one does not have allocatable
derived type components, so in the original code where the
example is derived from pointers are the only possibility.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38487