[PATCH] D42576: [test-suite] Add prototypes to functions in Olden and MiBench

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 03:19:50 PST 2018


arichardson added a comment.

Your example will work for x86 and probably ARM, but as far as I can tell it is up to the ABI which calling convention should be used for functions without prototypes.
For us these calling conventions are incompatible since the variadic one will pass arguments on the stack instead of in registers so if the target function is not actually variadic this will cause it to read garbage from undefined registers. While it *should* work if there is only zero or one arguments it is not guaranteed to work with more than 1.

I also found that apparently WebAssembly does the same: https://github.com/WebAssembly/tool-conventions/issues/16 and it also causes issues with functions without prototypes (https://bugs.llvm.org/show_bug.cgi?id=35385)


Repository:
  rT test-suite

https://reviews.llvm.org/D42576





More information about the llvm-commits mailing list