[LLVMdev] x86-64 sign extension for parameters and return values

Meador Inge meadori at gmail.com
Thu Feb 23 15:11:32 PST 2012

On Thu, Feb 23, 2012 at 3:54 PM, Eli Friedman <eli.friedman at gmail.com> wrote:

> LLVM has traditionally assumed that all integer argument and return
> types narrower than int are promoted to int on all architectures.
> Nobody has actually noticed any issues with this before now, as far as
> I know.

The only reason that I noticed was that Python ctypes started misbehaving
when we went to build/test it on OS X Lion (http://bugs.python.org/issue13370).
After investigating the failure I found this.  Python uses libffi and
libffi implements
the GCC ABI.  So I would expect any project using libffi with clang to
have problems.

> If gcc has decided to assume no sign/zero-extension on x86-64, we need
> to follow their lead, at least on Linux. Please file at
> http://llvm.org/bugs/ ; an executable testcase to go with this would
> be nice, so we can compare various compilers and different platforms.

Will do.  Thanks.

-- Meador

More information about the llvm-dev mailing list