[PATCH] D28820: Warn when calling a non interrupt function from an interrupt on ARM

Jonathan Roelofs via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 03:38:46 PST 2017


jroelofs added a comment.

In https://reviews.llvm.org/D28820#944365, @efriedma wrote:

> > What is the best way to modify the code for this compiler change ?
>
> Currently, the "interrupt" attribute only has an effect on functions, not function pointers, so your code won't work the way you want.  It's a bug that we don't emit a warning for this.


https://bugs.llvm.org/show_bug.cgi?id=35527

> Currently, this warning doesn't have its own warning flag, instead being lumped under -Wextra.  This is also a bug.

https://bugs.llvm.org/show_bug.cgi?id=35528

> We don't emit the warning if your code is compiled for a target which doesn't support floating-point (-mfpu=none or -msoft-float); see https://reviews.llvm.org/D32918. But otherwise, if you're sure your code is actually correct, you can turn off the warning with -Wno-extra or something like that.  (The whole thing is kind of awkward because the implementation of the interrupt attribute in clang is buggy: the frontend lies to the backend about the calling convention, so the backend can't save/restore VFP registers correctly.)

https://i.imgur.com/BFRoEUO.gif

In https://reviews.llvm.org/D28820#944706, @kc.austin2017 wrote:

> so is there any plan to make the "interrupt" attribute not just support on functions?


I'll fix these. Give me a few weeks though.


https://reviews.llvm.org/D28820





More information about the cfe-commits mailing list