<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Perusing the Clang source, I found something rather confusing:<div class=""><br class=""></div><div class=""><div class=""></div><blockquote type="cite" class=""><div class="">if ((IsVectorCall || IsRegCall) &&</div><div class="">      isHomogeneousAggregate(Ty, Base, NumElts)) {</div><div class="">    if (IsRegCall) {</div><div class="">      if (FreeSSERegs >= NumElts) {</div><div class="">        FreeSSERegs -= NumElts;</div><div class="">        if (IsReturnType || Ty->isBuiltinType() || Ty->isVectorType())</div><div class="">          return ABIArgInfo::getDirect();</div><div class="">        return ABIArgInfo::getExpand();</div><div class="">      }</div><div class="">      return ABIArgInfo::getIndirect(Align, /*ByVal=*/false);</div><div class="">    } else if (IsVectorCall) {</div><div class="">      if (FreeSSERegs >= NumElts &&</div><div class="">          (IsReturnType || Ty->isBuiltinType() || Ty->isVectorType())) {</div><div class="">        FreeSSERegs -= NumElts;</div><div class="">        return ABIArgInfo::getDirect();</div><div class="">      } else if (IsReturnType) {</div><div class="">        return ABIArgInfo::getExpand();</div><div class="">      } else if (!Ty->isBuiltinType() && !Ty->isVectorType()) {</div><div class="">        // HVAs are delayed and reclassified in the 2nd step.</div><div class="">        return ABIArgInfo::getIndirect(Align, /*ByVal=*/false);</div><div class="">      }</div><div class="">    }</div><div class="">  }</div></blockquote><div class=""><br class=""></div><div class="">If we look at ”<b class="">isReturnType</b>” for <b class="">IsVectorCall = true</b> has ”<b class="">ABIArgInfo::getExpand()</b>” however, ”expand” is not a valid type of ABIArgInfo and will throw an error.</div><div class=""><br class=""></div><div class="">So this seems to be incorrect and should crash on vectorcall with HVA. Can someone confirm?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">
<span class="Apple-style-span" style="border-collapse: separate; font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; line-height: normal; border-spacing: 0px; -webkit-text-decorations-in-effect: none;"><div class="">Christoffer</div><div class="">AEGIK / <a href="http://www.aegik.se" class="">www.aegik.se</a></div></span>

</div>

<br class=""></div></body></html>