[flang-commits] [flang] [flang][PFT] do not record a FORMAT statement as an assigned GO TO target (PR #216969)
Kareem Ergawy via flang-commits
flang-commits at lists.llvm.org
Tue Aug 18 23:30:38 PDT 2026
ergawy wrote:
> @eugeneepshteyn Can we somehow move branch target recording to semantic analysis so that we do not have to repeat that here? I will explore with Claude but also wanted your expert opinion.
I had a look at this and it seems like checking for `format` targets is enough because all other `assign` targets that are neither branch targets nor `format` targets are filtered out during semantic checking by `CheckAssignTargetConstraints` (see: https://github.com/llvm/llvm-project/blob/main/flang/lib/Semantics/resolve-labels.cpp#L1193). Note the `"Label '%u' is not a branch target or FORMAT"` message. Therefore, I believe, the changes in PR are enough.
That said, I opened a draft PR (https://github.com/llvm/llvm-project/pull/217220) that records valid branch targets during semantic analysis so that we have that logic isolated into one component rather having to single out `format` targets during lowering as is done in this PR.
cc: @sscalpone @eugeneepshteyn for your opinion.
https://github.com/llvm/llvm-project/pull/216969
More information about the flang-commits
mailing list