[Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings

2006-09-13 Thread tobi at gcc dot gnu dot org


--- Comment #8 from tobi at gcc dot gnu dot org  2006-09-13 16:11 ---
This is another variation of the theme in 26227

*** This bug has been marked as a duplicate of 26227 ***


-- 

tobi at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


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



[Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings

2006-08-04 Thread paul dot richard dot thomas at cea dot fr


--- Comment #7 from paul dot richard dot thomas at cea dot fr  2006-08-04 
07:50 ---
Just to reinforce the above, I should remark that an explicit interface in the
main program makes the code behave correctly (see below).

The standard requires that references to a procedure with an implicit interface
have the same number of actual arguments with the same type characteristics.

As Andrew says, gfortran does not check implicitly defined procedure arguments;
either for consistency of references within one scope or for a formal interface
generated by the procedure happening to be in the same file.

Paul

program test_string_present
interface
  subroutine test_present(a, b)
integer :: a
character*(*), optional :: b
  end subroutine test_present
end interface

call test_present(1, foo)
call test_present(2)

end program

subroutine test_present(a, b)
integer :: a
character*(*), optional :: b

if (present(b)) then
write (0,*) b is present.
else
write (0,*) b is not present.
end if

end subroutine test_present


-- 


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



[Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings

2006-07-24 Thread fxcoudert at gcc dot gnu dot org


-- 

fxcoudert at gcc dot gnu dot org changed:

   What|Removed |Added

   Severity|critical|normal


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



[Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings

2006-07-22 Thread pinskia at gcc dot gnu dot org


--- Comment #6 from pinskia at gcc dot gnu dot org  2006-07-22 08:32 ---
PR 26227 is the bug about accepting invalid code with different types and
numbers of dummy arguments.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

  BugsThisDependsOn||26227


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



[Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings

2006-07-21 Thread matthias dot langer at zamg dot ac dot at


--- Comment #3 from matthias dot langer at zamg dot ac dot at  2006-07-21 
08:11 ---
Created an attachment (id=11917)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11917action=view)
comment


-- 


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



[Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings

2006-07-21 Thread pinskia at gcc dot gnu dot org


--- Comment #4 from pinskia at gcc dot gnu dot org  2006-07-21 19:31 ---
Yes, this is most likely one of the accepts invalid bugs where gfortran does
not check the types of functions arguments already implicatedly defined.


-- 


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



[Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings

2006-07-21 Thread steven at gcc dot gnu dot org


--- Comment #5 from steven at gcc dot gnu dot org  2006-07-21 23:34 ---
Lahey agrees that this is invalid code:

  1program test_string_present
  2
  3call test_present(1, foo)
  4call test_present(2)
  5
  6end program
  7
  8subroutine test_present(a, b)
  9integer :: a
 10character*(*), optional :: b
 11
 12 1  if (present(b)) then
 13 1  write (0,*) b is present.
 14 1  else
 15 1  write (0,*) b is not present.
 16 1  end if
 17
 18end subroutine test_present


line 8: Dummy argument 'a' not used in this subprogram.
line 8: The previously procedure 'test_present' reference in 'line 3' shall
have the explicit interface, because that has the optional argument 'b'.
line 8: The argument number of procedure 'test_present' shall be the same
between definition and reference. The previous appearance is in 'line 4'.


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||accepts-invalid


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



[Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings

2006-07-20 Thread steven at gcc dot gnu dot org


--- Comment #1 from steven at gcc dot gnu dot org  2006-07-20 19:53 ---
Confirmed.


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

   Severity|normal  |critical
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
  GCC build triplet|i686-pc-linux-gnu   |
   GCC host triplet|i686-pc-linux-gnu   |
 GCC target triplet|i686-pc-linux-gnu   |
   Keywords||wrong-code
   Last reconfirmed|-00-00 00:00:00 |2006-07-20 19:53:45
   date||


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



[Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings

2006-07-20 Thread steven at gcc dot gnu dot org


--- Comment #2 from steven at gcc dot gnu dot org  2006-07-20 21:17 ---
From the tree dumps, it would appear we totally mis-handle omitted arguments:

;; Function MAIN__ (MAIN__)

MAIN__ ()
{
bb 2:
  _gfortran_set_std (70, 127, 0);
  test_present (C.1239, C.1240);
  test_present (C.1242);
  return;

}


-- 


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