[llvm-commits] CAST patch committed

Gordon Henriksen gordonhenriksen at mac.com
Tue Jan 16 20:49:04 PST 2007


On 2006-11-29, at 02:27, Chris Lattner wrote:

> On 2006-11-27, at 17:53, Reid Spencer wrote:
>
>> On Mon, 2006-11-27 at 14:28 -0800, Chris Lattner wrote:
>>
>>> the CBE doesn't implement the stacksave/restore builtins right.   
>>> If someone was interested in doing this, it should be possible to  
>>> use GCC extensions to implement this.
>>
>> Is there a PR open for this?
>
> No.  It should be really easy to implement them in terms of GCC's  
> __builtin_stack_save/__builtin_stack_restore builtins.  I don't  
> know what version of GCC these are available on though, we'd want  
> to conditionalize the CBE output correctly.  Filing a PR for this  
> would make sense.

The PR is <http://llvm.org/bugs/show_bug.cgi?id=1028>. A patch and  
test are attached.

A more ambitious fix would be to use preprocessor directives to noop  
out the calls on unsupported compilers. That should prove  
functionally identical except for the stack overflows. :) But since  
these intrinsics are not documented even on current compilers, it is  
unclear what condition to use. The stack builtins are available at  
least back to gcc 3.3 (c. 2003).

I don't have llvm-test properly set up, so I have not yet tried  
176.gcc with this change.

llvm-gcc seems to be unaffected, but it might be worth reviewing  
TreeToLLVM::EmitBuiltinCall (gcc/llvm-convert.cpp:3127) to check me.  
Stack save/restore seems to fall into the second case, which is  
unaffected by the changes to Intrinsics.td.

— Gordon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR1028.tar.gz
Type: application/x-gzip
Size: 723 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070116/9e02d6a4/attachment.bin>
-------------- next part --------------



More information about the llvm-commits mailing list