<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div>Yes, there are related discussions in r169197 and "[PATCH] Stack Alignment: clamp the alignment of stack objects in MachineFrameInfo".<div><br></div><div>But people can use a 32-byte alignment attribute on a machine which only supports 16-byte stack alignment.</div><div>If the source code further assumes the low bits are zeros, they will get wrong result.</div><div>But if not, a hard error is too much and it will make existing code which can compile with earlier version failed to build with this patch.</div><div><br></div><div>Thanks,</div><div>Manman</div><div><br><div><div>On Feb 4, 2013, at 5:05 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Having been in this argument at least 2 times I'm curious what the logic is and since most of the list doesn't have access to radar... what's the reason? This seems like something that should probably be wider discussed.<div>
<br></div><div>-eric</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 4, 2013 at 3:45 PM, Manman Ren <span dir="ltr"><<a href="mailto:mren@apple.com" target="_blank">mren@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: mren<br>
Date: Mon Feb  4 17:45:08 2013<br>
New Revision: 174336<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=174336&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=174336&view=rev</a><br>
Log:<br>
[Stack Alignment] emit warning instead of a hard error<br>
<br>
Per discussion in <a href="rdar://13127907">rdar://13127907</a>, we should emit a hard error only if<br>
people write code where the requested alignment is larger than achievable<br>
and assumes the low bits are zeros. A warning should be good enough when<br>
we are not sure if the source code assumes the low bits are zeros.<br>
<br>
<a href="rdar://13127907">rdar://13127907</a><br>
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/MachineFunction.cpp<br>
    llvm/trunk/test/CodeGen/ARM/alloc-no-stack-realign-error.ll<br>
<br>
Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=174336&r1=174335&r2=174336&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=174336&r1=174335&r2=174336&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Mon Feb  4 17:45:08 2013<br>
@@ -479,11 +479,11 @@ static inline unsigned clampStackAlignme<br>
   if (!ShouldClamp || PrefAlign <= StackAlign)<br>
     return PrefAlign;<br>
   if (Alloca && MinAlign > StackAlign)<br>
-    Alloca->getParent()->getContext().emitError(Alloca,<br>
-        "Requested Minimal Alignment exceeds the Stack Alignment!");<br>
+    Alloca->getParent()->getContext().emitWarning(Alloca,<br>
+        "Requested alignment exceeds the stack alignment!");<br>
   else<br>
     assert(MinAlign <= StackAlign &&<br>
-           "Requested Minimal Alignment exceeds the Stack Alignment!");<br>
+           "Requested alignment exceeds the stack alignment!");<br>
   return StackAlign;<br>
 }<br>
<br>
<br>
Modified: llvm/trunk/test/CodeGen/ARM/alloc-no-stack-realign-error.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/alloc-no-stack-realign-error.ll?rev=174336&r1=174335&r2=174336&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/alloc-no-stack-realign-error.ll?rev=174336&r1=174335&r2=174336&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/test/CodeGen/ARM/alloc-no-stack-realign-error.ll (original)<br>
+++ llvm/trunk/test/CodeGen/ARM/alloc-no-stack-realign-error.ll Mon Feb  4 17:45:08 2013<br>
@@ -6,10 +6,10 @@<br>
 ; If alignment for alloc is smaller than or equal to stack alignment, but the<br>
 ; preferred type alignment is bigger, the alignment will be clamped.<br>
 ; If alignment for alloca is bigger than stack alignment, the compiler<br>
-; will emit an error.<br>
+; will emit a warning.<br>
 define void @test(<16 x float>* noalias sret %agg.result) nounwind ssp {<br>
 entry:<br>
-; CHECK: Requested Minimal Alignment exceeds the Stack Alignment!<br>
+; CHECK: warning: Requested alignment exceeds the stack alignment!<br>
  %retval = alloca <16 x float>, align 16<br>
  %0 = load <16 x float>* @T3_retval, align 16<br>
  store <16 x float> %0, <16 x float>* %retval<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</blockquote></div><br></div></body></html>