On 01/29/2016 02:25 AM, Martin Sebor wrote:
What seems to happen is that the call to __builtin_alloca_with_align uses the stdu (store with update) instruction to store and bump down the stack pointer (SP) at the same time (standard for powerpc63le) to make room for the VLA. The subsequent code then reads the saved value of the SP and uses it as the address of the VLA. Since the SP is 64 bits wide, it clobbers the first two words of the VLA. The test looks at the second element, expecting it to be unchanged, but what it finds is the upper word of the saved SP. Since the saved SP value doesn't get read I don't see anything wrong with this.
Interesting. What's the point of storing the SP if it isn't going to be used to restore it later?
I think I'd prefer to disable the test on targets with quirks like this rather than everywhere.
Jason