This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/81048] [6/7/8 Regression] incorrect derived type initialization
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 10 Jun 2017 08:25:14 +0000
- Subject: [Bug fortran/81048] [6/7/8 Regression] incorrect derived type initialization
- Auto-submitted: auto-generated
- References: <bug-81048-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81048
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Status|UNCONFIRMED |NEW
Known to work| |5.4.0
Keywords| |wrong-code
Last reconfirmed| |2017-06-10
Ever confirmed|0 |1
Summary|incorrect derived type |[6/7/8 Regression]
|initialization |incorrect derived type
| |initialization
Known to fail| |6.3.0, 7.1.0, 8.0
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The change occurred between revisions r224647 (2015-06-19, OK) and r225925
(2015-07-17, wrong result).
Reduced test
program test
type f
integer :: f = -1
end type
type(f) :: a, b(3)
write (*,*) ' a%f = ', a%f
write (*,*) ' b(1:3)%f = ', b(1:3)%f
b = g2(a)
write (*,*) ' b = g(a) gives b(1:3)%f = ', b(1:3)%f
b = g2(a)
write (*,*) ' b = g(a) gives b(1:3)%f = ', b(1:3)%f
contains
function g2(a)
type(f) :: a, g2(3)
write (*,*) ' a%f = ', a%f
write (*,*) ' g2(1:3)%f = ', g2(1:3)%f
do j = 1, 3
if (g2(j)%f == -1) then
g2(j)%f = a%f - 1
else
g2(j)%f = a%f - 12345
endif
enddo
end function g2
end program test