IAS and inline assembly

While working on the IAS, I ran into a behavioural difference between GCC and clang.

The Linux Kernel relies on GCC’s acceptance of inline assembly as an opaque object which will not have any validation performed on the content. The current behaviour in LLVM is to perform validation of the contents by means of parsing the input if the MC layer can handle it.

When compiling to an object file, this distinction is unimportant since the assembler will have to parse the content anyways. However, the case where the emission is an assembly file (as used by the Linux kernel) is something which needs to be discussed.

The current options include:

  • continuing with the current behaviour (the user can disable the IAS even when assembling (-S) if necessary
  • behaving more like GCC and disabling the validation
  • introducing a new flag (-W{no-,}inline-asm-syntax ?) to control the behaviour
  • relaxing all errors to warnings

Personally, I think that the LLVM model is better since it allows for earlier diagnosis of errors. But, I am torn between options 1 and 3 and could be easily convinced that either is better.

This is sufficiently controversial that it deserves a separate thread of conversation.