<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
From the LLVM perspective, the maximum alignment is specified as:<br>
<pre class="fragment">In Value.h:
00520 <span class="comment"> /// \brief The maximum alignment for instructions.</span>
<a name="l00521"></a>00521 <span class="comment"> ///</span>
<a name="l00522"></a>00522 <span class="comment"> /// This is the greatest alignment value supported by load, store, and alloca</span>
<a name="l00523"></a>00523 <span class="comment"> /// instructions, and global values.</span>
<a name="l00524"></a><a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html#a50e02a54cc6f87a00a671265e1447e61">00524</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html#a50e02a54cc6f87a00a671265e1447e61" title="The maximum alignment for instructions.">MaxAlignmentExponent</a> = 29;
<a name="l00525"></a><a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html#a2885f6c5817ff68bc24bd1e22e221740">00525</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <a style="" class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html#a2885f6c5817ff68bc24bd1e22e221740">MaximumAlignment</a> = 1u << <a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html#a50e02a54cc6f87a00a671265e1447e61" title="The maximum alignment for instructions.">MaxAlignmentExponent</a>;
</pre>
This is checked in the Verifier via:<br>
Assert(GV.getAlignment() <= Value::MaximumAlignment,<br>
"huge alignment values are unsupported", &GV);<br>
(and similiar checks for Load, Store, Alloca, but not the various
atomic instructions)<br>
<br>
<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 02/14/2016 01:30 PM, don hinton via
cfe-dev wrote:<br>
</div>
<blockquote
cite="mid:CAL2T-v4aPc9dn_pxBHj2Gfg=WADUocsMU27bKTyzsVeQGQZ03A@mail.gmail.com"
type="cite">
<div dir="ltr">
<pre class="" id="comment_text_1" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)"><span style="font-family:arial,sans-serif">Sema::AddAlignment() defines MaxValidAlignment like this:</span>
</pre>
<pre class="" id="comment_text_1" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)"> // Alignment calculations can wrap around if it's greater than 2**28.
unsigned MaxValidAlignment =
Context.getTargetInfo().getTriple().isOSBinFormatCOFF() ? 8192
: 268435456;
But AggValueSlot stores Alignment as an unsigned short:
class AggValueSlot {
...
unsigned short Alignment;
The max value for an unsigned short is 2**16 -1, but you are passing 2**16, which AddeAlignment says is okay. However, it ends up getting stored as 0 in an unsigned short.
The fix is to make these sizes consistent, but I'm not sure which should be changed (though I'm guessing Alignment should be unsigned instead of unsigned short).</pre>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>