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: unassignedb...@nondot.org
Reporter: llvm-...@redking.me.uk
CC: coby.tay...@intel.com, llvm-bugs@lists.llvm.org,
mku...@google.com, r...@google.com, vice...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs