Skip to content

Commit 3151fb5

Browse files
committed
[flang] Change C889 from error into warning
This constraint is used in OMP2012 benchmark, and other compilers do not enforce it. Change it into one warning. This addresses the issue llvm/llvm-project#56003. Reviewed By: klausler, kiranchandramohan Differential Revision: https://reviews.llvm.org/D127740
1 parent 2dac2c4 commit 3151fb5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

flang/lib/Semantics/resolve-names.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5251,7 +5251,7 @@ void DeclarationVisitor::CheckSaveStmts() {
52515251
} else if (specPartState_.saveInfo.saveAll) {
52525252
// C889 - note that pgi, ifort, xlf do not enforce this constraint
52535253
Say2(name,
5254-
"Explicit SAVE of '%s' is redundant due to global SAVE statement"_err_en_US,
5254+
"Explicit SAVE of '%s' is redundant due to global SAVE statement"_warn_en_US,
52555255
*specPartState_.saveInfo.saveAll, "Global SAVE statement"_en_US);
52565256
} else if (auto msg{CheckSaveAttr(*symbol)}) {
52575257
Say(name, std::move(*msg));

flang/test/Semantics/resolve45.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ subroutine s3(x)
3434
end
3535

3636
subroutine s4
37-
!ERROR: Explicit SAVE of 'z' is redundant due to global SAVE statement
37+
!WARNING: Explicit SAVE of 'z' is redundant due to global SAVE statement
3838
save z
3939
save
4040
procedure(integer), pointer :: x
41-
!ERROR: Explicit SAVE of 'x' is redundant due to global SAVE statement
41+
!WARNING: Explicit SAVE of 'x' is redundant due to global SAVE statement
4242
save :: x
43-
!ERROR: Explicit SAVE of 'y' is redundant due to global SAVE statement
43+
!WARNING: Explicit SAVE of 'y' is redundant due to global SAVE statement
4444
integer, save :: y
4545
end
4646

0 commit comments

Comments
 (0)