https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71196
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
--- Comment #7 from anlauf at gcc dot gnu.org ---
More fun and confusion:
program p
type t
integer :: k
integer :: j
integer :: i
end type t
type t2
type(t) :: a
end type t2
type(t2) :: x
data x%a%k / 42 /
data x%a%i / 1 /
data x%a%j / -9 /
print *, x
end
compiles ok but prints:
-9 1 42
(should be: 42 -9 1)
-fdump-fortran-original says:
symtree: 'x' || symbol: 'x'
type spec : (DERIVED t2)
attributes: (VARIABLE DATA)
value: t2(t(-9 , 1 , 42))
How could the init data get mixed up, so that they are assigned in the
reverse order of how the appear in the code?