[Bug c++/89585] GCC 8.3: asm volatile no longer accepted at file scope

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 6 09:34:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89585

--- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 45903
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45903&action=edit
gcc9-pr89585.patch

Untested patch for better diagnostics of this in GCC 9, for GCC 8 we could just
not diagnose volatile and ignore it.

Now, looking at documentation, I'd say that the C parser didn't match the
documentation and the C++ parser did (and no longer does), because we said that
volatile is optional on Basic Asm, volatile and goto are allowed on Extended
Asm, that at toplevel only Basic Asm is allowed and for Basic Asm:
"The optional volatile qualifier has no effect.
All basic asm blocks are implicitly volatile."

To me that looks like a strong reason to at least accept it again in 8.x, it
wasn't any kind of unspecified behavior, it was documented to be ignored.
And perhaps we could reconsider this even for GCC 9 and allow and ignore even
in C at toplevel.


More information about the Gcc-bugs mailing list