Page MenuHomePhabricator

Fix tail allocation for large static alloca
ClosedPublic

Authored by serge-sans-paille on Jun 30 2020, 5:07 AM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2020, 5:07 AM
serge-sans-paille marked an inline comment as done.Jun 30 2020, 5:08 AM
serge-sans-paille added inline comments.
llvm/test/CodeGen/X86/stack-clash-large.ll
46

This mov wasn't relevant, as %r11d was clipped.

cuviper added inline comments.
llvm/test/CodeGen/X86/stack-clash-large.ll
24–25

I think this condition is also backwards -- in AT&T syntax, this will jump when %rsp<%r11, which is immediately false.

serge-sans-paille marked an inline comment as done.Jun 30 2020, 11:53 AM
serge-sans-paille added inline comments.
llvm/test/CodeGen/X86/stack-clash-large.ll
24–25

this could even be a jne, I guess.

cuviper added inline comments.Jun 30 2020, 12:58 PM
llvm/test/CodeGen/X86/stack-clash-large.ll
24–25

Yeah, jne should work. Maybe rename FinalStackPtr to something like FinalStackProbe too, so it's clear that doesn't include the remainder.

Take review into account: fix check.

serge-sans-paille marked 2 inline comments as done.Jun 30 2020, 2:16 PM

@cupiver. It should be okay for static allocations now.

cuviper accepted this revision.Jul 2 2020, 3:26 PM

LGTM, and I confirmed that it works in a full rustc bootstrap, thanks!

This revision is now accepted and ready to land.Jul 2 2020, 3:26 PM
This revision was automatically updated to reflect the committed changes.