[llvm-bugs] [Bug 35847] New: pushf/popw out of sync stack

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 7 08:28:35 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=35847

            Bug ID: 35847
           Summary: pushf/popw out of sync stack
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: coby.tayree at intel.com, llvm-bugs at lists.llvm.org,
                    mkuper at google.com, rnk at google.com, vicencb at gmail.com

Split from Bug #32035 Comment #3

> (In reply to Vicente Bergas from comment #3)
> Hello,
> this code:
> 
> #include <stdio.h>
> #include <stdint.h>
> int main() {
>   uint16_t u16;
>   asm(
>     "pushf\n"
>     "popw %0\n"
>     : "=r" (u16)
>   );
>   printf("0x%04hX\n", u16);
>   return(0);
> }
> 
> when assembled with clang -S generates
> ...
> pushfq
> popw %ax
> ...
> and the stack size gets out of sync.
> When executing the resulting program it segfaults.
> Tested also in GCC: works fine there.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180107/745ccb59/attachment.html>


More information about the llvm-bugs mailing list