* [Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings
2006-07-20 10:21 [Bug fortran/28443] New: gfortran does not implement the present intrinsic procedure correctly for optional character strings cyan+gcc at compsoc dot nuigalway dot ie
@ 2006-07-20 19:53 ` steven at gcc dot gnu dot org
2006-07-20 21:17 ` steven at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-07-20 19:53 UTC (permalink / raw)
To: gcc-bugs
------- 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|0000-00-00 00:00:00 |2006-07-20 19:53:45
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28443
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings
2006-07-20 10:21 [Bug fortran/28443] New: gfortran does not implement the present intrinsic procedure correctly for optional character strings cyan+gcc at compsoc dot nuigalway dot ie
2006-07-20 19:53 ` [Bug fortran/28443] " steven at gcc dot gnu dot org
@ 2006-07-20 21:17 ` steven at gcc dot gnu dot org
2006-07-21 8:11 ` matthias dot langer at zamg dot ac dot at
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-07-20 21:17 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings
2006-07-20 10:21 [Bug fortran/28443] New: gfortran does not implement the present intrinsic procedure correctly for optional character strings cyan+gcc at compsoc dot nuigalway dot ie
2006-07-20 19:53 ` [Bug fortran/28443] " steven at gcc dot gnu dot org
2006-07-20 21:17 ` steven at gcc dot gnu dot org
@ 2006-07-21 8:11 ` matthias dot langer at zamg dot ac dot at
2006-07-21 19:31 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: matthias dot langer at zamg dot ac dot at @ 2006-07-21 8:11 UTC (permalink / raw)
To: gcc-bugs
------- 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=11917&action=view)
comment
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28443
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings
2006-07-20 10:21 [Bug fortran/28443] New: gfortran does not implement the present intrinsic procedure correctly for optional character strings cyan+gcc at compsoc dot nuigalway dot ie
` (2 preceding siblings ...)
2006-07-21 8:11 ` matthias dot langer at zamg dot ac dot at
@ 2006-07-21 19:31 ` pinskia at gcc dot gnu dot org
2006-07-21 23:34 ` steven at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-21 19:31 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings
2006-07-20 10:21 [Bug fortran/28443] New: gfortran does not implement the present intrinsic procedure correctly for optional character strings cyan+gcc at compsoc dot nuigalway dot ie
` (3 preceding siblings ...)
2006-07-21 19:31 ` pinskia at gcc dot gnu dot org
@ 2006-07-21 23:34 ` steven at gcc dot gnu dot org
2006-07-22 8:32 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-07-21 23:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from steven at gcc dot gnu dot org 2006-07-21 23:34 -------
Lahey agrees that this is invalid code:
1 program test_string_present
2
3 call test_present(1, "foo")
4 call test_present(2)
5
6 end program
7
8 subroutine test_present(a, b)
9 integer :: a
10 character*(*), 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
18 end 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings
2006-07-20 10:21 [Bug fortran/28443] New: gfortran does not implement the present intrinsic procedure correctly for optional character strings cyan+gcc at compsoc dot nuigalway dot ie
` (4 preceding siblings ...)
2006-07-21 23:34 ` steven at gcc dot gnu dot org
@ 2006-07-22 8:32 ` pinskia at gcc dot gnu dot org
2006-07-24 19:30 ` fxcoudert at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-22 8:32 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings
2006-07-20 10:21 [Bug fortran/28443] New: gfortran does not implement the present intrinsic procedure correctly for optional character strings cyan+gcc at compsoc dot nuigalway dot ie
` (5 preceding siblings ...)
2006-07-22 8:32 ` pinskia at gcc dot gnu dot org
@ 2006-07-24 19:30 ` fxcoudert at gcc dot gnu dot org
2006-08-04 7:50 ` paul dot richard dot thomas at cea dot fr
2006-09-13 16:11 ` tobi at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-07-24 19:30 UTC (permalink / raw)
To: gcc-bugs
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28443
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings
2006-07-20 10:21 [Bug fortran/28443] New: gfortran does not implement the present intrinsic procedure correctly for optional character strings cyan+gcc at compsoc dot nuigalway dot ie
` (6 preceding siblings ...)
2006-07-24 19:30 ` fxcoudert at gcc dot gnu dot org
@ 2006-08-04 7:50 ` paul dot richard dot thomas at cea dot fr
2006-09-13 16:11 ` tobi at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: paul dot richard dot thomas at cea dot fr @ 2006-08-04 7:50 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/28443] gfortran does not implement the present intrinsic procedure correctly for optional character strings
2006-07-20 10:21 [Bug fortran/28443] New: gfortran does not implement the present intrinsic procedure correctly for optional character strings cyan+gcc at compsoc dot nuigalway dot ie
` (7 preceding siblings ...)
2006-08-04 7:50 ` paul dot richard dot thomas at cea dot fr
@ 2006-09-13 16:11 ` tobi at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: tobi at gcc dot gnu dot org @ 2006-09-13 16:11 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 10+ messages in thread