[llvm-commits] [llvm-gcc-4.2] r93388 - in /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg: ssp-1.c ssp-2.c
Eric Christopher
echristo at apple.com
Wed Jan 13 17:24:33 PST 2010
>>
>
> It's testing the stack-protector by clobbering its own stackframe.
>
Yep.
> 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.
>
Why did you have to change the order of declaration of variables? I'd be surprised if someone wasn't relying on this behavior, even if they're not supposed to.
> 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?
I'd say static and haul it out of the function, but I'm still concerned about the other.
-eric
More information about the llvm-commits
mailing list