Skip to content

Commit 506b4cd

Browse files
authored
[flang] Change vector always errors to warnings (#95908)
1 parent 74941d0 commit 506b4cd

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

flang/lib/Lower/Bridge.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,9 +2609,6 @@ class FirConverter : public Fortran::lower::AbstractConverter {
26092609

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

26172614
void genFIR(const Fortran::parser::CompilerDirective &dir) {

flang/lib/Semantics/canonicalize-directives.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void CanonicalizationOfDirectives::CheckLoopDirective(
104104
std::string s{parser::ToUpperCaseLetters(dir.source.ToString())};
105105
s.pop_back(); // Remove trailing newline from source string
106106
messages_.Say(
107-
dir.source, "A DO loop must follow the %s directive"_err_en_US, s);
107+
dir.source, "A DO loop must follow the %s directive"_warn_en_US, s);
108108
}
109109
}
110110

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
! RUN: %python %S/test_errors.py %s %flang
1+
! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror
22

33
subroutine empty
4-
! ERROR: A DO loop must follow the VECTOR ALWAYS directive
4+
! WARNING: A DO loop must follow the VECTOR ALWAYS directive
55
!dir$ vector always
66
end subroutine empty
77

88
subroutine non_do
9-
! ERROR: A DO loop must follow the VECTOR ALWAYS directive
9+
! WARNING: A DO loop must follow the VECTOR ALWAYS directive
1010
!dir$ vector always
1111
a = 1
1212
end subroutine non_do
1313

1414
subroutine execution_part
1515
do i=1,10
16-
! ERROR: A DO loop must follow the VECTOR ALWAYS directive
16+
! WARNING: A DO loop must follow the VECTOR ALWAYS directive
1717
!dir$ vector always
1818
end do
1919
end subroutine execution_part

0 commit comments

Comments
 (0)