* [Bug fortran/107444] ICE on character, value, optional dummy argument
2022-10-27 21:06 [Bug fortran/107444] New: ICE on character, value, optional dummy argument anlauf at gcc dot gnu.org
@ 2022-11-01 20:34 ` anlauf at gcc dot gnu.org
2022-11-01 20:54 ` anlauf at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-11-01 20:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107444
--- Comment #1 from anlauf at gcc dot gnu.org ---
It appears that there is also confusion about the procedure decl.
This is demonstrated by:
program p
call s()
call s('') ! Actual argument is too short, reject?
call s('a')
call s('ab')
contains
subroutine s (c)
character, value, optional :: c
end subroutine s
end
The dump tree shows:
void s (character(kind=1)[1:1] c, integer(kind=8) _c)
[...]
void p ()
{
static void s (character(kind=1)[1:1], integer(kind=8));
s (0B, 0);
s ("", 1, 0);
s ("a", 1, 1);
s ("ab", 1, 2);
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/107444] ICE on character, value, optional dummy argument
2022-10-27 21:06 [Bug fortran/107444] New: ICE on character, value, optional dummy argument anlauf at gcc dot gnu.org
2022-11-01 20:34 ` [Bug fortran/107444] " anlauf at gcc dot gnu.org
@ 2022-11-01 20:54 ` anlauf at gcc dot gnu.org
2022-11-01 21:15 ` anlauf at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-11-01 20:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107444
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
--- Comment #2 from anlauf at gcc dot gnu.org ---
OK, here's a better example of the weird situation:
program p
call s()
call s(i=7)
call s(c='a')
call s(r=3.0)
contains
subroutine s (i,c,r)
integer , value, optional :: i
character, value, optional :: c
real , value, optional :: r
print *, "present (i), present (r) =", present (i), present (r)
end subroutine s
end
With 12-branch this prints:
present (i), present (r) = F F
present (i), present (r) = T F
present (i), present (r) = F F ! right but for the wrong reason...
present (i), present (r) = F F ! should be F T
With 13-mainline + patch under review for pr107441(v2) I get:
present (i), present (r) = F F
present (i), present (r) = T F
present (i), present (r) = F T ! should be F F
present (i), present (r) = F T ! right but for the wrong reason...
So not a regression... ;-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/107444] ICE on character, value, optional dummy argument
2022-10-27 21:06 [Bug fortran/107444] New: ICE on character, value, optional dummy argument anlauf at gcc dot gnu.org
2022-11-01 20:34 ` [Bug fortran/107444] " anlauf at gcc dot gnu.org
2022-11-01 20:54 ` anlauf at gcc dot gnu.org
@ 2022-11-01 21:15 ` anlauf at gcc dot gnu.org
2022-11-09 21:07 ` anlauf at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-11-01 21:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107444
--- Comment #3 from anlauf at gcc dot gnu.org ---
Regarding ABI questions, I've inquired on the ML:
https://gcc.gnu.org/pipermail/fortran/2022-November/058410.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/107444] ICE on character, value, optional dummy argument
2022-10-27 21:06 [Bug fortran/107444] New: ICE on character, value, optional dummy argument anlauf at gcc dot gnu.org
` (2 preceding siblings ...)
2022-11-01 21:15 ` anlauf at gcc dot gnu.org
@ 2022-11-09 21:07 ` anlauf at gcc dot gnu.org
2022-11-10 21:57 ` anlauf at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-11-09 21:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107444
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2022-11-09
Assignee|unassigned at gcc dot gnu.org |anlauf at gcc dot gnu.org
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
--- Comment #4 from anlauf at gcc dot gnu.org ---
Working on a patch.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/107444] ICE on character, value, optional dummy argument
2022-10-27 21:06 [Bug fortran/107444] New: ICE on character, value, optional dummy argument anlauf at gcc dot gnu.org
` (3 preceding siblings ...)
2022-11-09 21:07 ` anlauf at gcc dot gnu.org
@ 2022-11-10 21:57 ` anlauf at gcc dot gnu.org
2022-11-12 20:18 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-11-10 21:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107444
--- Comment #5 from anlauf at gcc dot gnu.org ---
Submitted: https://gcc.gnu.org/pipermail/fortran/2022-November/058476.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/107444] ICE on character, value, optional dummy argument
2022-10-27 21:06 [Bug fortran/107444] New: ICE on character, value, optional dummy argument anlauf at gcc dot gnu.org
` (4 preceding siblings ...)
2022-11-10 21:57 ` anlauf at gcc dot gnu.org
@ 2022-11-12 20:18 ` cvs-commit at gcc dot gnu.org
2022-11-14 11:08 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-12 20:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107444
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:59a63247992eb13153b82c4902aadf111460eac2
commit r13-3931-g59a63247992eb13153b82c4902aadf111460eac2
Author: Harald Anlauf <anlauf@gmx.de>
Date: Thu Nov 10 22:30:27 2022 +0100
Fortran: fix treatment of character, value, optional dummy arguments
[PR107444]
Fix handling of character dummy arguments that have the optional+value
attribute. Change name of internal symbols that carry the hidden presence
status of optional arguments to distinguish them from the internal hidden
character length. Update documentation to clarify the gfortran ABI.
gcc/fortran/ChangeLog:
PR fortran/107444
* trans-decl.cc (create_function_arglist): Extend presence status
to all intrinsic types, and change prefix of internal symbol to
'.'.
* trans-expr.cc (gfc_conv_expr_present): Align to changes in
create_function_arglist.
(gfc_conv_procedure_call): Fix generation of procedure arguments
for
the case of character dummy arguments with optional+value
attribute.
* trans-types.cc (gfc_get_function_type): Synchronize with changes
to create_function_arglist.
* doc/gfortran/naming-and-argument-passing-conventions.rst: Clarify
the gfortran argument passing conventions with regard to OPTIONAL
dummy arguments of intrinsic type.
gcc/testsuite/ChangeLog:
PR fortran/107444
* gfortran.dg/optional_absent_7.f90: Adjust regex.
* gfortran.dg/optional_absent_8.f90: New test.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/107444] ICE on character, value, optional dummy argument
2022-10-27 21:06 [Bug fortran/107444] New: ICE on character, value, optional dummy argument anlauf at gcc dot gnu.org
` (5 preceding siblings ...)
2022-11-12 20:18 ` cvs-commit at gcc dot gnu.org
@ 2022-11-14 11:08 ` cvs-commit at gcc dot gnu.org
2022-11-16 20:54 ` anlauf at gcc dot gnu.org
2022-11-28 22:23 ` pinskia at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-14 11:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107444
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:04e2fd20d3d5fce2c99c856361d5f3d3ce955906
commit r13-4003-g04e2fd20d3d5fce2c99c856361d5f3d3ce955906
Author: Harald Anlauf <anlauf@gmx.de>
Date: Sun Nov 13 21:53:58 2022 +0100
Fortran: fix treatment of character, value, optional dummy arguments
[PR107444]
gcc/fortran/ChangeLog:
PR fortran/107444
* trans-openmp.cc (gfc_omp_check_optional_argument): Adjust to
change
of prefix of internal symbol for presence status to '.'.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/107444] ICE on character, value, optional dummy argument
2022-10-27 21:06 [Bug fortran/107444] New: ICE on character, value, optional dummy argument anlauf at gcc dot gnu.org
` (6 preceding siblings ...)
2022-11-14 11:08 ` cvs-commit at gcc dot gnu.org
@ 2022-11-16 20:54 ` anlauf at gcc dot gnu.org
2022-11-28 22:23 ` pinskia at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-11-16 20:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107444
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from anlauf at gcc dot gnu.org ---
Fixed for gcc-13.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/107444] ICE on character, value, optional dummy argument
2022-10-27 21:06 [Bug fortran/107444] New: ICE on character, value, optional dummy argument anlauf at gcc dot gnu.org
` (7 preceding siblings ...)
2022-11-16 20:54 ` anlauf at gcc dot gnu.org
@ 2022-11-28 22:23 ` pinskia at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-28 22:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107444
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
^ permalink raw reply [flat|nested] 10+ messages in thread