[llvm-commits] [llvm] r58489 - in /llvm/trunk/lib: CodeGen/PrologEpilogInserter.cpp Target/X86/X86RegisterInfo.cpp

Chris Lattner clattner at apple.com
Thu Oct 30 23:41:23 PDT 2008


On Oct 30, 2008, at 11:24 PM, Bill Wendling wrote:

> On Oct 30, 2008, at 11:09 PM, Chris Lattner wrote:
>
>> On Oct 30, 2008, at 9:00 PM, Bill Wendling wrote:
>>
>>> Author: void
>>> Date: Thu Oct 30 23:00:23 2008
>>> New Revision: 58489
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=58489&view=rev
>>> Log:
>>> Don't skip over all "terminator" instructions when determining  
>>> where to put the
>>> callee-saved restore code. It could skip over conditional jumps
>>> accidentally. Instead, just skip the "return" instructions.
>>
>> Testcase?
>>
> No. This came about because of stuff I'm doing for stack protectors.  
> I'd basically end up with an epilogue that looked like this:
>
> 	cmpl	%edx, %ecx
> 	addl	$1068, %esp
> 	jne	LBB1_5	## CallStackCheckFailBlk
> 	popl	%esi
> 	popl	%edi
> 	popl	%ebx
> 	popl	%ebp
> 	ret
>
> instead of this:
>
> 	cmpl	%edx, %ecx
> 	jne	LBB1_5	## CallStackCheckFailBlk
> 	addl	$1068, %esp
> 	popl	%esi
> 	popl	%edi
> 	popl	%ebx
> 	popl	%ebp
> 	ret
>
> But that's after I inserted some code.

I don't think this is right.  We should never have a jump and ret in  
the same block.  You stack protector stuff should put the ret in a  
separate fall-through block or something.

-Chris



More information about the llvm-commits mailing list