<div dir="ltr">The attached patch fixes a bug where the __ebx output is clobbered. Currently, clang generates the following code when cpuid.c in the test case is compiled:<div><br></div><div>$ clang cpuid.c -O3 -S -o -</div>
<div><br></div><div><p style="margin:0px;font-size:11px;font-family:Menlo">## InlineAsm Start</p><p style="margin:0px;font-size:11px;font-family:Menlo">pushl  %ebx      # save %ebx before cpuid clobbers it.</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">cpuid</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">mov    %ebx,%ebx # move the __ebx output to %ebx.</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">popl   %ebx      # pop saved %ebx. Clobbers __ebx output.</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">## InlineAsm End</p></div><div><br></div><div><div>This happens because register '"ebx" is chosen for operand %1 which has constraint "=r". The attached patch adds %ebx to the clobber list to prevent this from happening.</div>
</div><div><br></div></div>