[Bug fortran/51260] PARAMETER array with constructor initializer: Compile-time simplify single element access
jvdelisle at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Mar 24 23:34:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51260
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jvdelisle at gcc dot gnu.org
--- Comment #6 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
There is a similar problem going on with pr66709, only with a string:
program p
character(4), parameter :: fmt(1) = '(i8)'
integer :: n
read (*, fmt=fmt) n
write (*, fmt=fmt) n
end
The parameter expr gets into trans-io as an ARRAY_EXPR with rank 0.
I have tried gfc_simplify_expr and that does not do it.
If one removes the 'parameter' attribute this compiles and runs fine. So
somewhere in the parameter processing we are missing something.
More information about the Gcc-bugs
mailing list