<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/153067>153067</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[llc] [AIX] coredump on AIX with Fortran procedure pointer reference.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:PowerPC
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DanielCChen
</td>
</tr>
</table>
<pre>
Consider the following code:
```
MODULE M
CONTAINS
FUNCTION FChar(Arg)
CHARACTER :: Arg
CHARACTER :: FChar
FChar = Arg
END FUNCTION
END MODULE
PROGRAM Misc6
USE M
PROCEDURE(FChar), POINTER :: ProcPtr
character :: res
ProcPtr => FChar
! res = FChar(IntFun1 (FChar, "2")) !! label 1: work around 1
res = ProcPtr(IntFun1 (FChar, "2")) !! label 2:
res = ProcPtr(IntFun1 (ProcPtr, "3")) !! label 3:
CONTAINS
FUNCTION IntFun1(Arg1, Arg2)
CHARACTER(*) :: Arg1, Arg2
CHARACTER(LEN(Arg2)) :: IntFun1
IntFun1 = Arg1(Arg2)
END FUNCTION
END
```
Compile command:
```
...../build/bin/flang -ffree-form t.f ; a.out
Segmentation fault(coredump)
```
This is a AIX specific issue. It works fine on LoP.
It works fine if `-O2` is specified.
It works fine if I swap `label 2` line and `label 3` line.
It works fine if I replace `lable 2` line with `label 1` line.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMlF2PsjgUxz9NuTmRQEHUCy4YlF2TGTXOTPLc1nKQ7lNb05bH7LfflBedmd3ZXWMCnJff-Zf-KbNWnBViTuZPZL4OWOdabfI1UwJlWbaogpOu_8xLrayo0YBrERotpb4JdQauayRJQaKCZNH4jwqAl_36_XkDLz7hn8v97q3Y7l6n5-p9V75t9zuoypYZQpeFORO68rny9-JYlG-bI3hwUoBP9YyviaHXp2C4B5Ks7-Wb3fo-ZhzrQ4OyScfhuP_tWLzAi7A86yPvr4Ps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