<div dir="ltr"><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.850000381469727px">The x87 FP stackifier pass has a bug where the liveness of an ST register defined by an inline-asm instruction is not tracked precisely.</p>
<p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.850000381469727px">This causes the assertion on line 1365 to fail when an ST register defined by an inline-asm is live across another inline-asm, as shown in the following example:</p>
<p style="margin:0px;font-size:11px;font-family:Menlo"><span style="color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.850000381469727px">INLINEASM <es:frndint> [sideeffect] [attdialect], $0:[regdef], %ST0<imp-def,tied5>, $1:[reguse tiedto:$0], %ST0<tied3>, $2:[clobber], %EFLAGS<earlyclobber,imp-def,dead></span><br>
</p><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.850000381469727px">INLINEASM <es:fldcw $0> [sideeffect] [mayload] [attdialect], $0:[mem], %EAX<undef>, 1, %noreg, 0, %noreg, $1:[clobber], %EFLAGS<earlyclobber,imp-def,dead><br>
%FP0<def> = COPY %ST0 // %ST0 is defined by the first inline-asm instruction.</p><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.850000381469727px">
In order to fix this bug, the attached patch uses FP registers for function returns and inline-asm instructions where previously ST registers were being used and adds kill flags that are missing in FP register operands.</p>
<p style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.850000381469727px">rdar://problem/16952634</p></div>