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

Evan Cheng evan.cheng at apple.com
Fri Oct 31 09:46:32 PDT 2008


Chris is right. Sorry I didn't point this out. Bill, the original plan  
was for you to introduce a separate block for the stack check code?

Evan

On Oct 30, 2008, at 11:41 PM, Chris Lattner wrote:

>
> 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
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list