[Bug fortran/49802] [F03] [F08] Wrong code with VALUE, VALUE with arrays/DIMENSION
jvdelisle at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 4 19:44:46 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49802
--- Comment #13 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
(In reply to Harald Anlauf from comment #12)
> (In reply to Jerry DeLisle from comment #11)
> > As far as I can tell, this has since been fixed. I checked the various cases
> > in the comments. C3 will run correctly if the code is fixed.
> >
> > implicit none
> > character(len=10) :: str
> >
> > str = "123456789"
> > call by_value(str)
> > print *, str
> > if (str /= "123456789") call abort()
> >
> > contains
> > subroutine by_value(y)
> > !character(len=*), value :: y ------ Not allowed with value
> > character(len=10), value :: y
> >
> > print *, len(y)
> > if (len(y) /= 10) call abort()
> > print *, y
> > y = "abcdefghij"
> > print *, y
> > !if (str /= "abcdefghij") call abort() ------- Bogus test
> > if (y /= "abcdefghij") call abort()
> >
> > end subroutine
> > end
> >
> > Closing as fixed
>
> Jerry, assumed length is valid, at least in F2023:8.5.19.
>
> Reopening.
I will investigate. Thanks Harald.
More information about the Gcc-bugs
mailing list