diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -293,9 +293,10 @@ "a pointer as the first parameter|a %2 type as the second parameter}1">; def err_anyx86_interrupt_called : Error< "interrupt service routine cannot be called directly">; -def err_anyx86_interrupt_regsave : Error< - "interrupt service routine may only call a function" - " with attribute 'no_caller_saved_registers'">; +def warn_anyx86_interrupt_regsave : Warning< + "interrupt service routine should only call a function" + " with attribute 'no_caller_saved_registers'">, + InGroup; def warn_arm_interrupt_calling_convention : Warning< "call to function without interrupt attribute could clobber interruptee's VFP registers">, InGroup; diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -6607,7 +6607,7 @@ } if (Caller->hasAttr() && ((!FDecl || !FDecl->hasAttr()))) { - Diag(Fn->getExprLoc(), diag::err_anyx86_interrupt_regsave); + Diag(Fn->getExprLoc(), diag::warn_anyx86_interrupt_regsave); if (FDecl) Diag(FDecl->getLocation(), diag::note_callee_decl) << FDecl; } diff --git a/clang/test/Sema/attr-x86-interrupt.c b/clang/test/Sema/attr-x86-interrupt.c --- a/clang/test/Sema/attr-x86-interrupt.c +++ b/clang/test/Sema/attr-x86-interrupt.c @@ -51,7 +51,7 @@ __attribute__((no_caller_saved_registers)) #else // expected-note@+3 {{'foo9' declared here}} -// expected-error@+4 {{interrupt service routine may only call a function with attribute 'no_caller_saved_registers'}} +// expected-warning@+4 {{interrupt service routine should only call a function with attribute 'no_caller_saved_registers'}} #endif void foo9(int *a, Arg2Type b) {} __attribute__((interrupt)) void fooA(int *a, Arg2Type b) {