New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISPC doesn't comply with Win64 ABI #1318
Comments
PR #2630 adds Consider the following example:
It is compiled by the following command: > ispc.exe --target=host -O0 -o .\uwtable\ex.ispc.obj --emit-obj .\ex.ispc Without > llvm-objdump.exe --section-headers .\ex.ispc.obj
.\ex.ispc.obj: file format coff-x86-64
Sections:
Idx Name Size VMA Type
0 .text 000001d6 0000000000000000 TEXT
1 .data 00000000 0000000000000000 DATA
2 .bss 00000000 0000000000000000 BSS
3 .rdata 00000004 0000000000000000 DATA
4 .rdata 00000004 0000000000000000 DATA
5 .drectve 00000033 0000000000000000
> llvm-objdump.exe --unwind-info .\ex.ispc.obj
.\ex.ispc.obj: file format coff-x86-64
Unwind info:
With > llvm-objdump.exe --section-headers .\ex.ispc.obj
.\ex.ispc.obj: file format coff-x86-64
Sections:
Idx Name Size VMA Type
0 .text 000001d6 0000000000000000 TEXT
1 .data 00000000 0000000000000000 DATA
2 .bss 00000000 0000000000000000 BSS
3 .xdata 00000014 0000000000000000 DATA
4 .rdata 00000004 0000000000000000 DATA
5 .rdata 00000004 0000000000000000 DATA
6 .drectve 00000033 0000000000000000
7 .pdata 00000018 0000000000000000 DATA
> llvm-objdump.exe --unwind-info .\ex.ispc.obj
.\ex.ispc.obj: file format coff-x86-64
Unwind info:
Function Table:
Start Address: .text
End Address: .text + 0x00c6
Unwind Info Address: .xdata
Version: 1
Flags: 0
Size of prolog: 16
Number of Codes: 4
Frame register: RBP
Frame offset: 128
Unwind Codes:
0x10: UOP_SetFPReg
0x08: UOP_AllocLarge 62
0x01: UOP_PushNonVol RBP
Function Table:
Start Address: .text + 0x00d0
End Address: .text + 0x013f
Unwind Info Address: .xdata + 0x000c
Version: 1
Flags: 0
Size of prolog: 4
Number of Codes: 1
No frame pointer used
Unwind Codes:
0x04: UOP_AllocSmall 72
Regarding |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ISPC does not fully comply with the Windows x86-64 ABI. In all Windows ABIs except x86-32, every function that modifies the stack pointer is required to have an entry in the exception tables (
.pdata
and.xdata
sections). This allows the stack to be unwound properly in the event of an exception. Only x86-32 Windows is exempt from this rule: x86-64, ARMv7-Thumb2 and ARM64 Windows all use exception tables.Without these exception tables, if an exception occurs,
__try
blocks will not be respected, and the process will simply crash. In addition, call stacks will not be generated properly in a crash dump or when debugging into ISPC-generated code.There are additional strict rules about the format of prolog and epilog code, but I didn't see any issues there.
https://msdn.microsoft.com/en-us/library/ms235286.aspx
The text was updated successfully, but these errors were encountered: