[Flang] [OpenMP] Geometric proliferation of error message lines for each unterminated OpenMP block construct in a Fortran scoping unit.
I noticed that multiple OpenMP errors of this kind cause substantial slowdown and excessive error message output.
#!/bin/bash
constructs=(parallel sections workshare paralleldo task master single critical)
for z in $(seq 0 31)
do
(
for i in $(seq 0 "${z}")
do
echo "!\$omp " "${constructs[$(( i % 8 ))]}"
done
echo end
) > src.f90
srcs=$(wc -l src.f90 | cut -d " " -f 1)
# cat src.f90
flang-new -c -fopenmp src.f90 |& wc -l > errs.txt
errs=$(cat errs.txt)
echo "$srcs" "$errs"
done
Hello Themos, Are you requesting for better error messages from the compiler for unterminated block constructs?
Yes. At the moment, a 20 line source, can take 20 seconds to produce 835,000+ lines of error messages.
@llvm/issue-subscribers-flang-frontend
Author: None (thtsikas)
#!/bin/bash
constructs=(parallel sections workshare paralleldo task master single critical)
for z in $(seq 0 31)
do
(
for i in $(seq 0 "${z}")
do
echo "!\$omp " "${constructs[$(( i % 8 ))]}"
done
echo end
) > src.f90
srcs=$(wc -l src.f90 | cut -d " " -f 1)
# cat src.f90
flang-new -c -fopenmp src.f90 |& wc -l > errs.txt
errs=$(cat errs.txt)
echo "$srcs" "$errs"
done
Does https://github.com/llvm/llvm-project/pull/90480 make it better?
Sadly, no. It's not the quality of the messages that is the problem in this Issue. It is the quantity of them and the cpu time expended.
The parser is reporting the scope of the error. As the nesting of the scope increases there are more messages in the error message for the nested scopes. This can be reproduced without OpenMP in the following example.
block
block
block
block
block
block
block
block
block
block
end
Reopened since the patch does not fix this issue. I missed removing the fixes tag before submitting.
Hi @tblah, just checking that after your merged PRs, can we potentially close this issue? Thanks!
Closing. After my changes the progression of error messages is approximately linear and completes in a short amount of time.
My changes only fixed the OpenMP case, Kiran's non-OpenMP reproducer will still have the same issue.