Skip to content

[flang] Change vector always errors to warnings #95908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions flang/lib/Lower/Bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2607,9 +2607,6 @@ class FirConverter : public Fortran::lower::AbstractConverter {

if (e->isA<Fortran::parser::NonLabelDoStmt>())
e->dirs.push_back(&dir);
else
fir::emitFatalError(toLocation(),
"loop directive must appear before a loop");
}

void genFIR(const Fortran::parser::CompilerDirective &dir) {
Expand Down
2 changes: 1 addition & 1 deletion flang/lib/Semantics/canonicalize-directives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void CanonicalizationOfDirectives::CheckLoopDirective(
std::string s{parser::ToUpperCaseLetters(dir.source.ToString())};
s.pop_back(); // Remove trailing newline from source string
messages_.Say(
dir.source, "A DO loop must follow the %s directive"_err_en_US, s);
dir.source, "A DO loop must follow the %s directive"_warn_en_US, s);
}
}

Expand Down
8 changes: 4 additions & 4 deletions flang/test/Semantics/loop-directives.f90
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
! RUN: %python %S/test_errors.py %s %flang
! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror

subroutine empty
! ERROR: A DO loop must follow the VECTOR ALWAYS directive
! WARNING: A DO loop must follow the VECTOR ALWAYS directive
!dir$ vector always
end subroutine empty

subroutine non_do
! ERROR: A DO loop must follow the VECTOR ALWAYS directive
! WARNING: A DO loop must follow the VECTOR ALWAYS directive
!dir$ vector always
a = 1
end subroutine non_do

subroutine execution_part
do i=1,10
! ERROR: A DO loop must follow the VECTOR ALWAYS directive
! WARNING: A DO loop must follow the VECTOR ALWAYS directive
!dir$ vector always
end do
end subroutine execution_part
Loading