On OSX I thought I'd try to optimize my compiler a bit by switching some of the calling conventions from CCallingConv to FastCC. The compiler ran fine, but when I executed the code, I got "Bad Instruction 4". I'm seeing some other mentions on this mailing list of issues like this on OSX (I'm using 10.8). Is there anything I need to change to enable fastcc with my compiler? I also tried the X86FastCCCallingConv and that died with the same error. Thanks, Timothy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130305/afd18141/attachment.html>
On Tue, Mar 5, 2013 at 7:43 AM, Timothy Baldridge <tbaldridge at gmail.com>wrote:> On OSX I thought I'd try to optimize my compiler a bit by switching some > of the calling conventions from CCallingConv to FastCC. The compiler ran > fine, but when I executed the code, I got "Bad Instruction 4". I'm seeing > some other mentions on this mailing list of issues like this on OSX (I'm > using 10.8). Is there anything I need to change to enable fastcc with my > compiler? I also tried the X86FastCCCallingConv and that died with the same > error. >fastcc isn't a stable ABI and you shouldn't use it for external symbols, unless you're certain that those symbols will be linked to a module built with the exact same version of the exact same compiler binary with the exact same build flags and exact same LLVM passes and the exact sameā¦don't do it. There are optimizer passes that will automatically promote internal symbols to 'fastcc' when it's safe to do so. If you only extern symbols that actually need external linkage, then the calling convention becomes the optimizer's problem. -Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130305/442b9bc8/attachment.html>
Hi Timothy, On 05/03/13 16:43, Timothy Baldridge wrote:> On OSX I thought I'd try to optimize my compiler a bit by switching some of the > calling conventions from CCallingConv to FastCC. The compiler ran fine, but when > I executed the code, I got "Bad Instruction 4". I'm seeing some other mentions > on this mailing list of issues like this on OSX (I'm using 10.8). Is there > anything I need to change to enable fastcc with my compiler? I also tried the > X86FastCCCallingConv and that died with the same error.don't forgot that you need to put the fastcc convention on the called function as well as on all call/invoke instructions that call it. Ciao, Duncan.