<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJzNWF1z2jgU_TXwojFjyZ888JCEsE2nbVKSZjv7wsi2DNr4g5HlhPTX75XMhw2mmCSdWYYQkKyjc6_OPZYV5NHrKEmeUxTmacplz7pAzPNc4jpWZAVmzxz3zIspW4o8KkOGXrhcwDVVMwoTms2RYUgq5gzGjle-O3Nto8yesvwlMxKelStkhMi4xciYoyDghuuYxB1AU456ZBKxZ_jMyiRBRqp5GM9M8PjVSGm44BnjWSFFUc23IVOUidyRuIglE-in76LJHbqXNHziMWdi3fu1goHwIobiXKC4zELJ8wyFKtZv-d2nm6JHrtCDgJHFF_7MMlbolm_545TNq07OottlMWUvgkvJst2AMQvK-Y-CiUealGxNdCJoytBt8C8LZbFjimLeI5ap5i34Lwb5shUQTfg82_6QKMlDqhn2nMv7ux659HvOuAGB3w9B3g9h1SBIHYJ0hrDfAVF9BsHAHLBMitdanosyDGERc6GSDzJz4CrcI765sszq1SNDNUPVRXSXU-uyLmujLG_gQKtzMMYlu44aJYQEy2hKg4TBxTYLVwgiQl9vHy0iUtUk-FIh4QrOznLB5vq7bQb7bZESmLHLA8HERCpWHZkfMcFi-MtCpidMchqp9gJWmAxRLPK0BotlQKnGIOswayUJiGo9vPYo6DlR0A5ReOdHQbtFYW4ieLi-fwC24mBBFE5bG0-XCQ-5NCIW6-Y4oZUDtATgtudvuJn989XVDO_kcoWc-hQn4f0Ty_P5690WHr8JY1tBeMDjgVyAr21qSI1bChaxgzoyf1dklq4kv62SVBc2zYHZqBiEEnBcMPkKQ8ls06GVlgo1vFCuXgV5oDZzv-GJJwmLDtR7JEPDmgoLCRg12fFM5o3pW7Tm1Ff85st4NgHSZ3Nu6C5iWvx2vCxe9hUTL8OXNqEW0uwQYGtZnRHf-PKv2c23-4fpbHo9QaQWCsbe-sv45noFyikKIABTrU3zkJi6Dx4t3Lq2rSPjcTtZZ0_bRGmbJQX7X2i7WnflNutLrsbfD12HtptRtDowkGO6Vvf3_ex48IfxVqvjG-Xk7eVyxA1beG3Eukeu2be1uRbu26Y1kR3WW6I6MA3zD5iGZXU2DbO1qLx6UWV5vGSrkC0lUvaBP8YMNvL6dD-b_AZxfdnFGGa-aThXx8SdTbYlnXZXizqeTey0exT-Ux619RdL-0sWdbAXsts-4uaGUZGGB5EqT5qu1R6P9ec8dwKTXP2N3Vq-rTdo4Pzld1qrCbuH1WS1rr-v1t88tWv956fat2L37OhOMN4KtiLcFOybCd9OgS0_bku-hCdSne_No4xleqSDA7dFc4ohZA9kUTNVu1vmGrSPu_1Rm-0uDLtDnidfxnvy7hjGKXnv2jtJ_LeC6RLIzf3DbHLXMGvy8YVabzu6uzytncOsf5CpfGTW3-Mr66fh8xaiK9m2m2D7M2-T7PT6YTvp8fpqeYBVMFbj3nSdRSg9fog2qF_cI-s3uqTNUSqwHwXP5ohmqMxg7aAnQsvFa8FDmkB257xQ53hbiArR2E6lEOAVbtoDCiNRAAE91fboqLoZI71Xp57rB5653ZAbSJ8mllu8o7ddA-VLJigAmdW86yt0Z0wlMGZC5EIfl6ovgAyMwqdqI4AmOcSIcDNx-sKimTDnspb_wfyXOt0i_kLKpT43JBN4z7lclMEgzFP4oc5I1_-MpcjVCSP8jHnCwN4n3hDu8XCXJ5M92E0K-tHIiobWkPZpKRe5GKX8ibJkkScpy_qlSEZnz82LotSTO5Zluf3FKLJsPKTDIApZFEQEe9R3QtcPsR8Mh47p9xMawAPZCILvEZKxF6Qh4DtE338_Az4iJiEmhg0Sth1iD2xieRHDrulh4rDhsGebLKU8GSicQS7mfaHPwA2okAI6E5BiseuksK-aZ4xpwsBQcpmw0aM6puag2Gr9aVyplxweRBOij803p-X6KLyvOY804f8AqymlLw>53336</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Verifier error after "X86 FP Stackifier" with clang -O1 -g
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mikaelholmen
</td>
</tr>
</table>
<pre>
llvm commit: e7762653d3b0
Reproduce with:
clang --target=x86_64-unknown-linux -c -O1 -g bbi-65026.c -o /dev/null -mllvm -verify-machineinstrs
Result:
After X86 FP Stackifier
Machine code for function c: NoPHIs, TracksLiveness, NoVRegs, TiedOpsRewritten, TracksDebugUserValues
Frame Objects:
fi#0: size=4, align=4, at location [SP+8]
fi#1: size=4, align=4, at location [SP+8]
fi#2: size=4, align=4, at location [SP+8]
fi#3: size=2, align=2, at location [SP+8]
fi#4: size=2, align=2, at location [SP+8]
bb.0.entry:
successors: %bb.1(0x30000000), %bb.2(0x50000000); %bb.1(37.50%), %bb.2(62.50%)
renamable $ecx = MOV32rm $rip, 1, $noreg, @b, $noreg, debug-location !20 :: (dereferenceable load (s32) from @b, !tbaa !22); bbi-65026.c:4:7
renamable $eax = MOV32rm $rip, 1, $noreg, @a, $noreg, debug-location !27 :: (dereferenceable load (s32) from @a, !tbaa !22); bbi-65026.c:0
TEST32rr renamable $ecx, renamable $ecx, implicit-def $eflags, debug-location !26; bbi-65026.c:4:9
JCC_1 %bb.2, 5, implicit $eflags, debug-location !28; bbi-65026.c:4:7
JMP_1 %bb.1, debug-location !28; bbi-65026.c:4:7
bb.1.if.then:
; predecessors: %bb.0
successors: %bb.3(0x80000000); %bb.3(100.00%)
liveins: $eax
MOV32mr %stack.1, 1, $noreg, 0, $noreg, killed renamable $eax, debug-location !29 :: (store (s32) into %stack.1); bbi-65026.c:5:9
ILD_F32m %stack.1, 1, $noreg, 0, $noreg, implicit-def dead $fpsw, implicit $fpcw, implicit-def $st0, debug-location !29 :: (load (s32) from %stack.1); bbi-65026.c:5:9
DBG_INSTR_REF 2, 0, !17, !DIExpression(), debug-location !30; bbi-65026.c:0
JMP_1 %bb.3, debug-location !31; bbi-65026.c:5:5
bb.2.if.else:
; predecessors: %bb.0
successors: %bb.3(0x80000000); %bb.3(100.00%)
liveins: $eax, $ecx
CDQ implicit-def $eax, implicit-def $edx, implicit $eax, debug-location !32; bbi-65026.c:7:11
IDIV32r killed renamable $ecx, implicit-def $eax, implicit-def dead $edx, implicit-def dead $eflags, implicit $eax, implicit killed $edx, debug-location !32; bbi-65026.c:7:11
MOV32mr %stack.0, 1, $noreg, 0, $noreg, killed renamable $eax, debug-location !33 :: (store (s32) into %stack.0); bbi-65026.c:7:9
nofpexcept LD_F1 implicit-def dead $fpsw, implicit $fpcw, implicit-def $st0
CHS_F implicit-def dead $fpsw
ADD_FI32m %stack.0, 1, $noreg, 0, $noreg, implicit-def dead $fpsw, implicit $fpcw, debug-location !34 :: (load (s32) from %stack.0); bbi-65026.c:7:15
DBG_INSTR_REF 1, 0, !17, !DIExpression(), debug-location !30; bbi-65026.c:0
bb.3.if.end:
; predecessors: %bb.2, %bb.1
DBG_PHI $fp0, 3
DBG_INSTR_REF 3, 0, !17, !DIExpression(), debug-location !30; bbi-65026.c:0
FNSTCW16m %stack.3, 1, $noreg, 0, $noreg, implicit-def $fpsw, implicit $fpcw, debug-location !35 :: (store (s16) into %stack.3); bbi-65026.c:8:10
renamable $eax = MOVZX32rm16 %stack.3, 1, $noreg, 0, $noreg, debug-location !35 :: (load (s16) from %stack.3); bbi-65026.c:8:10
renamable $eax = OR32ri killed renamable $eax(tied-def 0), 3072, implicit-def dead $eflags, debug-location !35; bbi-65026.c:8:10
MOV16mr %stack.4, 1, $noreg, 0, $noreg, renamable $ax, implicit killed $eax, debug-location !35 :: (store (s16) into %stack.4); bbi-65026.c:8:10
FLDCW16m %stack.4, 1, $noreg, 0, $noreg, implicit-def $fpsw, implicit-def $fpcw, debug-location !35 :: (load (s16) from %stack.4); bbi-65026.c:8:10
IST_FP32m %stack.2, 1, $noreg, 0, $noreg, implicit-def $fpsw, implicit $fpcw, implicit $st0, debug-location !35; bbi-65026.c:8:10
FLDCW16m %stack.3, 1, $noreg, 0, $noreg, implicit-def $fpsw, implicit-def $fpcw, debug-location !35 :: (load (s16) from %stack.3); bbi-65026.c:8:10
renamable $eax = MOV32rm %stack.2, 1, $noreg, 0, $noreg, debug-location !35 :: (load (s32) from %stack.2); bbi-65026.c:8:10
RET 0, $eax, debug-location !36; bbi-65026.c:8:3
End machine code for function c.
*** Bad machine code: Using an undefined physical register ***
- function: c
- basic block: %bb.3 if.end (0xa768b70)
- instruction: DBG_PHI $fp0, 3
- operand 0: $fp0
fatal error: error in backend: Found 1 machine code errors.
[bbi-65026.c.gz](https://github.com/llvm/llvm-project/files/7913030/bbi-65026.c.gz)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNWF1z2jgU_TXwojEjS_7igYckhG06bZOSNNvZF0a2ZdDGH4xsJ6S_fq9kPmwwxSTpzDKEgGQdnXt17rEsPwtfR3H8nKAgSxJR9OgF4q7rEMemIfVxD497-GLKlzILy4CjF1Es4JqqGQUxS-fIMAom5xzGjleeM3Mso0yf0uwlNWKRlitkBMi4NZExR74vDMfGxBlAU4Z6ZBLyZ_hMyzhGRqJ5GM9ciujVSFiwECkXaV7IvJpvQyYv42JH4iIquEQ_PQdN7tB9wYInEQku171fKxgIL-QoyiSKyjQoRJaiQMX6Lbv7dJP3yBV6kDAy_yKeecpz3fIte5zyedUpeHi7zKf8RYqi4OluwJj75fxHzuUji0u-JjqRLOHo1v-XB0W-Y4oi0SMUq3lz8YtDviwFxGIxT7c_ChRnAdMMe_bl_V2PXHo9e9yAMN8PQd4PQWsQpA5BOkNY74CoPn1_gAc8LeRrLc95GQSwiJlUyQeZ2XCV2SMeXlFcvXpkqGaouojusmtd9LI2iroDG1rtgzEO2XXUKCEkecoS5sccLrZ4sEIQEfp6-0iJTFSTFEuFZFZwVppJPtffLezvt4VKYMYuD8QkGKlYdWReyCWP4C8NuJ4wzlio2nNYYTJEkcySGqxZ-IxpDLIOs1aSgKjWw22Pgp0TBesQhXt-FKxbFHgTwcP1_QOwlQcLonDa2kSyjEUgCiPkkW6OYlY5QEsATnv-hpvZP19dzcydXK6QXZ_iJLx3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