llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Allocate character with source returns stat = 0 when already allocated

Open clementval opened this issue 3 years ago • 13 comments

The issue comes from the fact that AllocatableInitCharacter is called before AllocatableAllocateSource and resets the descriptor before the check is done.

program test
  character(:), allocatable :: ch
  ch = 'dummy'
 
  allocate(ch, stat=istat, source='fail?')
  if (istat == 0) then
    print*, 'fail to report correct stat'
  end if
end program

clementval avatar Feb 21 '23 10:02 clementval

@llvm/issue-subscribers-flang-ir

llvmbot avatar Feb 21 '23 10:02 llvmbot

@llvm/issue-subscribers-flang-runtime

llvmbot avatar Feb 21 '23 10:02 llvmbot

FYI @peixin Might be a simple enough issue for someone who wants to contribute.

clementval avatar Feb 21 '23 10:02 clementval

Might be a simple enough issue for someone who wants to contribute.

Agree. More people are welcome to contribute. Thanks @clementval.

PeixinQiao avatar Feb 21 '23 10:02 PeixinQiao

@llvm/issue-subscribers-good-first-issue

llvmbot avatar Feb 21 '23 15:02 llvmbot

Hi @clementval, is anyone working on it? if not can I do this?

sankeerth125 avatar Feb 24 '23 08:02 sankeerth125

@sankeerth125 You can take it. I just assigned it to you.

clementval avatar Feb 24 '23 08:02 clementval

@clementval Thank You

sankeerth125 avatar Feb 24 '23 08:02 sankeerth125

Let me know if anything is unclear

clementval avatar Feb 24 '23 08:02 clementval

I want to contribute to this issue. Please help me how can I contribute like directory level and all.

ipriyanshi1708 avatar Mar 17 '23 17:03 ipriyanshi1708

There are two patches accepted that solve this so you should look at other issues.

clementval avatar Mar 17 '23 20:03 clementval

@clementval: Could you please provide commits information?

EugeneZelenko avatar Mar 20 '23 15:03 EugeneZelenko

Fix by 029313cc979ae71877b65794b1063d4e51184cc8 and 52e239794f35be6a68b2273f88a99d9207e77cab

clementval avatar Mar 20 '23 16:03 clementval