[Bug fortran/85750] [12/13/14 Regression] Default initialization of derived type array missing

2025-05-25 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85750

--- Comment #18 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:0100ea2b4eb1c83972e0db07503a7cfe8a38932e

commit r14-11805-g0100ea2b4eb1c83972e0db07503a7cfe8a38932e
Author: Harald Anlauf 
Date:   Thu May 15 21:07:07 2025 +0200

Fortran: default-initialization and functions returning derived type
[PR85750]

Functions with non-pointer, non-allocatable result and of derived type did
not always get initialized although the type had default-initialization,
and a derived type component had the allocatable or pointer attribute.
Rearrange the logic when to apply default-initialization.

PR fortran/85750

gcc/fortran/ChangeLog:

* resolve.cc (resolve_symbol): Reorder conditions when to apply
default-initializers.

gcc/testsuite/ChangeLog:

* gfortran.dg/alloc_comp_auto_array_3.f90: Adjust scan counts.
* gfortran.dg/alloc_comp_class_3.f03: Remove bogus warnings.
* gfortran.dg/alloc_comp_class_4.f03: Likewise.
* gfortran.dg/allocate_with_source_14.f03: Adjust scan count.
* gfortran.dg/derived_constructor_comps_6.f90: Likewise.
* gfortran.dg/derived_result_5.f90: New test.

(cherry picked from commit d31ab498b12ebbe4f50acb2aa240ff92c73f310c)

[Bug fortran/85750] [12/13/14 Regression] Default initialization of derived type array missing

2025-05-22 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85750

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

Summary|[12/13/14/15/16 Regression] |[12/13/14 Regression]
   |Default initialization of   |Default initialization of
   |derived type array missing  |derived type array missing

--- Comment #17 from anlauf at gcc dot gnu.org ---
Fixed on mainline for gcc-16, and on 15-branch so far.