<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 30, 2017, at 2:12 PM, Francois Pichet <<a href="mailto:pichet2000@gmail.com" class="">pichet2000@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Wed, Aug 30, 2017 at 4:04 PM, Adrian Prantl via llvm-commits<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">Author: adrian<br class="">Date: Wed Aug 30 13:04:17 2017<br class="">New Revision: 312165<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=312165&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project?rev=312165&view=rev</a><br class="">Log:<br class="">Refactor DIBuilder::<wbr class="">createFragmentExpression into a static DIExpression member<br class=""><br class="">NFC<br class=""><br class="">Modified:<br class="">   <span class="Apple-converted-space"> </span>llvm/trunk/include/llvm/IR/<wbr class="">DIBuilder.h<br class="">   <span class="Apple-converted-space"> </span>llvm/trunk/include/llvm/IR/<wbr class="">DebugInfoMetadata.h<br class="">   <span class="Apple-converted-space"> </span>llvm/trunk/lib/CodeGen/<wbr class="">SelectionDAG/LegalizeTypes.cpp<br class="">   <span class="Apple-converted-space"> </span>llvm/trunk/lib/IR/DIBuilder.<wbr class="">cpp<br class="">   <span class="Apple-converted-space"> </span>llvm/trunk/lib/IR/<wbr class="">DebugInfoMetadata.cpp<br class="">   <span class="Apple-converted-space"> </span>llvm/trunk/lib/Transforms/IPO/<wbr class="">GlobalOpt.cpp<br class="">   <span class="Apple-converted-space"> </span>llvm/trunk/lib/Transforms/<wbr class="">Scalar/SROA.cpp<br class=""><br class=""><br class=""><br class="">Modified: llvm/trunk/lib/IR/<wbr class="">DebugInfoMetadata.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfoMetadata.cpp?rev=312165&r1=312164&r2=312165&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/lib/IR/<wbr class="">DebugInfoMetadata.cpp?rev=<wbr class="">312165&r1=312164&r2=312165&<wbr class="">view=diff</a><br class="">==============================<wbr class="">==============================<wbr class="">==================<br class="">--- llvm/trunk/lib/IR/<wbr class="">DebugInfoMetadata.cpp (original)<br class="">+++ llvm/trunk/lib/IR/<wbr class="">DebugInfoMetadata.cpp Wed Aug 30 13:04:17 2017<br class="">@@ -724,6 +724,34 @@ DIExpression *DIExpression::prepend(cons<br class="">   return DIExpression::get(Expr-><wbr class="">getContext(), Ops);<br class=""> }<br class=""><br class="">+DIExpression *DIExpression::<wbr class="">createFragmentExpression(const DIExpression *Expr,<br class="">+                                                     unsigned OffsetInBits,<br class="">+                                                     unsigned SizeInBits) {<br class="">+  SmallVector<uint64_t, 8> Ops;<br class="">+  // Copy over the expression, but leave off any trailing DW_OP_LLVM_fragment.<br class="">+  if (Expr) {<br class="">+    for (auto Op : Expr->expr_ops()) {<br class="">+      if (Op.getOp() == dwarf::DW_OP_LLVM_fragment) {<br class="">+        // Make the new offset point into the existing fragment.<br class="">+        uint64_t FragmentOffsetInBits = Op.getArg(0);<br class="">+        // Op.getArg(0) is FragmentOffsetInBits.<br class="">+        // Op.getArg(1) is FragmentSizeInBits.<br class="">+        assert((OffsetInBits + SizeInBits <= Op.getArg(0) + Op.getArg(1)) &&<br class="">+               "new fragment outside of original fragment");<br class=""></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> Hi, </div><div class=""><br class=""></div><div class="">I am getting an assert here on an (out of tree) big-endian target where 64-bit variables are splitted on 2 32-bit variables.</div><div class="">assert where: OffsetInBits=32, SizeInBits=32 and Expr: !DIExpression(DW_OP_LLVM_fragment, 0, 32)</div><div class="">so 32 + 32 <= 32 is not true.</div><div class=""><br class=""></div><div class="">I might be wrong but I think the assert is only valid on little endian target?</div></div></div></blockquote><br class=""></div><div>I'm not sure I understand your example. Are you saying that you are calling createFragmentExpression on something that is already 32-bit fragment? Which pass is calling it? It seems more likely that there is something wrong with the call site.</div><div><br class=""></div><div>-- adrian</div><div><br class=""></div><br class=""></body></html>