Skip to content

[flang] problem with multiple allocation #60303

Closed
@k-arrows

Description

@k-arrows

Original test code:
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gfortran.dg/multiple_allocation_1.f90

For sake of simplicity, I modified the original test code:

$ cat multiple_allocation_1_modify.f90
program alloc_test
  implicit none
  integer :: i
  integer, allocatable :: a(:)

  allocate(a(4))
  allocate(a(3),stat=i)
  print *, size(a)

end program

Result (gfortran vs flang-new)

$ gfortran multiple_allocation_1_modify.f90
$ ./a.out
           4

$ flang-new -flang-experimental-exec multiple_allocation_1_modify.f90
$ ./a.out
 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorflang:runtime

    Type

    No type

    Projects

    Status

    Done

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions