[Bug fortran/81048] [6/7/8 Regression] incorrect derived type initialization

2017-10-19 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81048

Paul Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Paul Thomas  ---
Fixed on 6-, 7- and 8-branches.

Thanks for the report.

Paul

[Bug fortran/81048] [6/7/8 Regression] incorrect derived type initialization

2017-10-19 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81048

--- Comment #6 from Paul Thomas  ---
Author: pault
Date: Thu Oct 19 12:16:41 2017
New Revision: 253889

URL: https://gcc.gnu.org/viewcvs?rev=253889=gcc=rev
Log:
2017-10-19  Paul Thomas  

PR fortran/81048
* resolve.c (resolve_symbol): Ensure that derived type array
results get default initialization.

2017-10-19  Paul Thomas  

PR fortran/81048
* gfortran.dg/derived_init_4.f90 : New test.

Added:
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/derived_init_4.f90
Modified:
branches/gcc-6-branch/gcc/fortran/ChangeLog
branches/gcc-6-branch/gcc/fortran/resolve.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug fortran/81048] [6/7/8 Regression] incorrect derived type initialization

2017-10-16 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81048

--- Comment #5 from Paul Thomas  ---
Author: pault
Date: Mon Oct 16 18:48:56 2017
New Revision: 253793

URL: https://gcc.gnu.org/viewcvs?rev=253793=gcc=rev
Log:
2017-10-16  Paul Thomas  

PR fortran/81048
* resolve.c (resolve_symbol): Ensure that derived type array
results get default initialization.

2017-10-16  Paul Thomas  

PR fortran/81048
* gfortran.dg/derived_init_4.f90 : New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/derived_init_4.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/resolve.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/81048] [6/7/8 Regression] incorrect derived type initialization

2017-10-13 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81048

--- Comment #4 from Paul Thomas  ---
Author: pault
Date: Fri Oct 13 18:59:34 2017
New Revision: 253738

URL: https://gcc.gnu.org/viewcvs?rev=253738=gcc=rev
Log:
2017-10-13  Paul Thomas  

PR fortran/81048
* resolve.c (resolve_symbol): Ensure that derived type array
results get default initialization.

2017-10-13  Paul Thomas  

PR fortran/81048
* gfortran.dg/derived_init_4.f90 : New test.

Added:
trunk/gcc/testsuite/gfortran.dg/derived_init_4.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/81048] [6/7/8 Regression] incorrect derived type initialization

2017-10-13 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81048

Paul Thomas  changed:

   What|Removed |Added

 CC||pault at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org

--- Comment #3 from Paul Thomas  ---
The offending revision is 225447. The chunk that causes the problem is
currently at line 14970. Reverting it fixes this problem but now causes the new
testcases in the revision to fail and a couple of other regressions.

Please use the following workaround, while I figure out a patch:

   function g2(a)
  type(f) :: a, g2(3)
  g2 = f() ! Apply the default initializer (PR81048)

Cheers

Paul

[Bug fortran/81048] [6/7/8 Regression] incorrect derived type initialization

2017-07-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81048

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|6.4 |6.5

--- Comment #2 from Richard Biener  ---
GCC 6.4 is being released, adjusting target milestone.

[Bug fortran/81048] [6/7/8 Regression] incorrect derived type initialization

2017-06-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81048

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.4

[Bug fortran/81048] [6/7/8 Regression] incorrect derived type initialization

2017-06-10 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81048

Dominique d'Humieres  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  ---
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