<div class="gmail_quote">On Fri, Jun 8, 2012 at 12:39 PM, David Sehr <span dir="ltr"><<a href="mailto:sehr@google.com" target="_blank">sehr@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To back up a couple of steps:<br>
1) __builtin_alloca currently returns a value aligned less than the<br>
stack frame (basically always 0mod4) for LLVM, which is incompatible<br>
with the same builtin in gcc, which seems bad.<br>
2) I'm proposing aligning __builtin_alloca return values to SuitableAlign.<br></blockquote><div><br></div><div>I don't think we need to back up further than this...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How about we proceed with aligning __builtin_alloca<br></blockquote><div><br></div><div>Yes. Let's just align it to SuitableAlign. As Jakob and I have pointed out, the cost of this is minimal. You shouldn't have to do anything in clang here -- just emit the alloca with the alignment constraint. In LLVM we should ensure that this alignment constraint is satisfied either by existing stack alignment constraints (if present) or by codegening a sufficiently large alloca and masking off the low bits.</div>
<div><br></div><div><br></div><div>I don't think we need to have some theoretically pure model for __builtin_alloca -- I think we just want to be able to placement new any object which is not over-aligned into the allocated space -- exactly what making it suitably aligned provides.</div>
<div><br></div><div>I also don't think we want to change the stack alignment of any targets -- that's an ABI break. We've already suffered enough for the ABI breaks imposed on x86-32.</div><div><br></div><div>
I also don't think we can change suitable alignment of any targets -- that's an even worse ABI break, and will break piles of code.</div><div><br></div><div>Fortunately I don't think these are blocking issues. =]</div>
</div>