[Bug fortran/108889] [12/13/14/15 Regression] (Re)Allocate in assignment shows used uninitialized memory warning with -Wall if LHS is unallocated
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 18 07:51:56 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108889
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:
https://gcc.gnu.org/g:c3aa339ea50f050caf7ed2e497f5499ec2d7b9cc
commit r15-2135-gc3aa339ea50f050caf7ed2e497f5499ec2d7b9cc
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Thu Jul 18 08:51:35 2024 +0100
Fortran: Suppress bogus used uninitialized warnings [PR108889].
2024-07-18 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/108889
* gfortran.h: Add bit field 'allocated_in_scope' to gfc_symbol.
* trans-array.cc (gfc_array_allocate): Set 'allocated_in_scope'
after allocation if not a component reference.
(gfc_alloc_allocatable_for_assignment): If 'allocated_in_scope'
not set, not a component ref and not allocated, set the array
bounds and offset to give zero length in all dimensions. Then
set allocated_in_scope.
gcc/testsuite/
PR fortran/108889
* gfortran.dg/pr108889.f90: New test.
More information about the Gcc-bugs
mailing list