[PATCH] D55616: Emit ASM input in a constant context

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 11 17:25:41 PST 2019


george.karpenkov added a comment.

@void @efriedma I can't build XNU anymore after this commit, with an error message:

  osfmk/i386/genassym.c:298:2: error: value '18446743523953737728' out of range for constraint 'n'
          DECLAREULL("KERNEL_BASE", KERNEL_BASE);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  osfmk/i386/genassym.c:107:65: note: expanded from macro 'DECLAREULL'
          __asm("DEFINITION__define__" SYM ":\t .ascii \"%0\"" : : "n"  ((unsigned long long)(VAL)))
                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~

The error message looks wrong: the value is in range to fit in `unsigned long long` (but I'm not an inline assembly expert).

At a minimum, could we add a test case to this change to show in which cases an extra diagnostics would appear?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55616/new/

https://reviews.llvm.org/D55616





More information about the cfe-commits mailing list