[llvm-commits] [llvm-gcc-4.2] r93388 - in /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg: ssp-1.c ssp-2.c

Stuart Hastings stuart at apple.com
Wed Jan 13 17:14:11 PST 2010


On Jan 13, 2010, at 5:08 PM, Eric Christopher wrote:

>
> On Jan 13, 2010, at 4:46 PM, Stuart Hastings wrote:
>
>> Author: stuart
>> Date: Wed Jan 13 18:46:15 2010
>> New Revision: 93388
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=93388&view=rev
>> Log:
>> Move loop index out of stack in stack-clobbering testcases.
>
> ?
>
> -eric

It's testing the stack-protector by clobbering its own stackframe.

I'm about to commit some lexical-block debug stuff, and I had to  
change the order of declaration of variables.  That's not supposed to  
break anything, but...  lots of breakage.

For these two tiny test cases, GCC allocated the loop index in a  
register, even at -O0.  At -O0, LLVM put that variable on the stack.

When I disturbed the order of declaration, the loop index moved  
*above* the array-to-clobber, the loop clobbered its own index, and  
then it looped indefinitely.

(Note: my patch to change the order of declaration hasn't been  
committed yet.)

Making the loop index static moves it far away from the clobbering.   
Bill says we can replace the loop and its index variable with a call  
to memset().

Do you have a strong opinion on this?

stuart



More information about the llvm-commits mailing list