This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/79864] Implicit type conversion on assignment of unallocated array to unallocated array variable segfaults.


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79864

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Note, there is a small difference to pr78963

Should be 79863.

Compiling the test with '-Wall -Wextra -fcheck=all -Ofast -m32
-fsanitize=address' gives

pr79864.f90:4:0:

   si = ssi

Warning: 'ssi.dim[0].ubound' may be used uninitialized in this function
[-Wmaybe-uninitialized]
pr79864.f90:2:0:

   integer(kind=1), allocatable :: ssi(:)

note: 'ssi.dim[0].ubound' was declared here
pr79864.f90:4:0:

   si = ssi

Warning: 'ssi.dim[0].lbound' may be used uninitialized in this function
[-Wmaybe-uninitialized]
pr79864.f90:2:0:

   integer(kind=1), allocatable :: ssi(:)

note: 'ssi.dim[0].lbound' was declared here
pr79864.f90:4:0:

   si = ssi

Warning: 'si.dim[0].ubound' may be used uninitialized in this function
[-Wmaybe-uninitialized]
pr79864.f90:1:0:

   integer, allocatable :: si(:)

note: 'si.dim[0].ubound' was declared here
pr79864.f90:4:0:

   si = ssi

Warning: 'si.dim[0].lbound' may be used uninitialized in this function
[-Wmaybe-uninitialized]
pr79864.f90:1:0:

   integer, allocatable :: si(:)

note: 'si.dim[0].lbound' was declared here

unless the patch in pr52162 comment 8 is applied.

Note that I don't see any segfault at run time.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]