<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi all<div class=""><br class=""></div><div class=""><div class="">TL;DR: Indexing maps with [] creates missing entries.</div><div class=""><br class=""></div><div class="">The long version:</div><div class=""><br class=""></div><div class="">When selecting lifetime intrinsics, we index the *static* alloca map with the AllocaInst we find for that lifetime.  Trouble is, we don't first check to see if this is a dynamic alloca.</div><div class=""><br class=""></div><div class="">On the attached example, this causes a dynamic alloca to create an entry in the static map, and returns 0 (the default) as the frame index for that lifetime.  0 was used for the frame index of the stack protector, which given that it now has a lifetime, is coloured, and merged with other stack slots.</div><div class=""><br class=""></div><div class="">PEI would later trigger an assert because it expects the stack protector to not be dead.</div><div class=""><br class=""></div><div class="">This fix ensures that we only get the frame indices for static allocas, ie, those in the map.  Dynamic ones are effectively dropped, which is suboptimal, but at least isn't completely broken.</div><div class=""><br class=""></div><div class=""><a href="rdar://problem/18672951" class="">rdar://problem/18672951</a></div></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Pete</div><div class=""><br class=""></div><div class=""></div></body></html>