Page MenuHomePhabricator

mgrang (Mandeep Singh Grang)
http://livgently.com

Projects

User does not belong to any projects.

User Details

User Since
Jan 28 2015, 2:26 PM (207 w, 3 d)

Recent Activity

Fri, Jan 18

mgrang committed rLLD351612: [lld] Use range-based llvm::sort.
[lld] Use range-based llvm::sort
Fri, Jan 18, 3:45 PM
mgrang committed rL351612: [lld] Use range-based llvm::sort.
[lld] Use range-based llvm::sort
Fri, Jan 18, 3:45 PM
mgrang committed rL351574: [GlobalISel] Change to range-based invocation of llvm::sort.
[GlobalISel] Change to range-based invocation of llvm::sort
Fri, Jan 18, 10:58 AM
mgrang committed rC351573: [clang] Change to range-based invocation of llvm::sort.
[clang] Change to range-based invocation of llvm::sort
Fri, Jan 18, 10:49 AM
mgrang committed rL351573: [clang] Change to range-based invocation of llvm::sort.
[clang] Change to range-based invocation of llvm::sort
Fri, Jan 18, 10:49 AM

Thu, Jan 17

mgrang committed rL351502: [polly] Change to range-based invocation of llvm::sort.
[polly] Change to range-based invocation of llvm::sort
Thu, Jan 17, 5:10 PM

Wed, Jan 16

mgrang committed rL351370: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
[COFF, ARM64] Implement support for SEH extensions __try/__except/__finally
Wed, Jan 16, 11:57 AM
mgrang closed D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Wed, Jan 16, 11:57 AM
mgrang abandoned D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.

I have added a default lowering for llvm.eh.recoverfp in D53540. So this patch is no longer needed.

Wed, Jan 16, 11:46 AM
mgrang removed a child revision for D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc.: D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Wed, Jan 16, 11:44 AM
mgrang removed a child revision for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc: D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Wed, Jan 16, 11:44 AM
mgrang removed parent revisions for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally: D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic, D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc, D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Wed, Jan 16, 11:44 AM
mgrang removed a child revision for D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic: D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Wed, Jan 16, 11:44 AM
mgrang added a comment to D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.

@rnk @efriedma Thanks a lot for all your valuable review comments. I'll commit this now :)

Wed, Jan 16, 11:41 AM
mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Wed, Jan 16, 11:38 AM

Tue, Jan 15

mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.

Added a default lowering for llvm.eh.recoverfp intrinsic.

Tue, Jan 15, 5:20 PM
mgrang added inline comments to D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 5:15 PM
mgrang removed a parent revision for D56748: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp: D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 4:43 PM
mgrang removed a child revision for D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp: D56748: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 4:43 PM
mgrang committed rL351281: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
[EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp
Tue, Jan 15, 4:41 PM
mgrang closed D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 4:41 PM
mgrang updated the diff for D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 4:33 PM
mgrang updated the diff for D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.

Rebased.

Tue, Jan 15, 4:08 PM
mgrang updated the diff for D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 3:41 PM
mgrang added a comment to D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.

I have renamed llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp in D56747 and D56748.

Tue, Jan 15, 3:21 PM
mgrang updated the summary of D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 3:21 PM
mgrang added a parent revision for D56748: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp: D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 3:21 PM
mgrang added a child revision for D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp: D56748: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 3:21 PM
mgrang created D56748: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 3:20 PM
mgrang created D56747: [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp.
Tue, Jan 15, 3:19 PM
mgrang added a comment to D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.
In D53541#1358210, @rnk wrote:

I can't compile the example you gave yet because I haven't applied your patches locally, but this is the "three stack pointer" case that I have in mind:

struct Foo {
  void (*ptr)();
  int x, y, z;
};

void escape(void *);
void large_align(int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7,
                 int stackarg) {
  struct Foo __declspec(align(32)) alignedlocal;
  alignedlocal.x = 42;
  int vla[a0];
  escape(&alignedlocal);
  vla[0] = stackarg;
  escape(&vla[0]);
}

This is LLVM's generated code:

"?large_align@@YAXHHHHHHHHH@Z":         ; @"?large_align@@YAXHHHHHHHHH@Z"
.seh_proc "?large_align@@YAXHHHHHHHHH@Z"
; %bb.0:                                ; %entry
        stp     x21, x22, [sp, #-48]!   ; 16-byte Folded Spill
        stp     x19, x20, [sp, #16]     ; 16-byte Folded Spill
        stp     x29, x30, [sp, #32]     ; 16-byte Folded Spill
        add     x29, sp, #32            ; =32
        sub     x9, sp, #48             ; =48
        and     sp, x9, #0xffffffffffffffe0
        mov     x19, sp
        mov     w8, #42
        str     w8, [x19, #8]
        mov     w8, w0
        ldr     w22, [x29, #16]
        lsl     x8, x8, #2
        add     x8, x8, #15             ; =15
        lsr     x15, x8, #4
        mov     x21, sp
        bl      __chkstk
        mov     x8, sp
        sub     x20, x8, x15, lsl #4
        mov     sp, x20
        add     x0, x19, #0             ; =0
        bl      "?escape@@YAXPEAX@Z"
        mov     x0, x20
        str     w22, [x20]
        bl      "?escape@@YAXPEAX@Z"
        mov     sp, x21
        sub     sp, x29, #32            ; =32
        ldp     x29, x30, [sp, #32]     ; 16-byte Folded Reload
        ldp     x19, x20, [sp, #16]     ; 16-byte Folded Reload
        ldp     x21, x22, [sp], #48     ; 16-byte Folded Reload
        ret

I see three pointers used to address the stack:

  • sp: to address vla
  • x19: to address locals, the so-called "base" pointer
  • x29: to address parameters on the stack, looks like the traditional FP, points to FP+LR pair as well

    At least for x86, the unwind info doesn't describe X19, it just describes X29, since that's what you need to restore CSRs and find the parent stack frame. We saw that the Windows EH runtime passes in some value based on the unwind info. For x86, it was just whatever EBP held, so recoverfp simply aligns that value forward to recover the base pointer (ESI) and then uses that to recover locals. For x64, the runtime passes in the value of RSP after the prologue ends, so we adjust it by the "parent frame offset" to get back the value we put in RBP. It looks like for x64 we never handled the case I'm asking you about, because this program doesn't print the right value: ` #include <stdio.h> struct Foo { void (*ptr)(); int x, y, z; }; int filter(int n) { printf("o.x: %d\n", n); return 1; } void may_throw() { builtin_trap(); } int main() { struct Foo declspec(align(32)) o; o.x = 42; try { may_throw(); } except(filter(o.x)) { } } `

    I get "o.x: 0" instead of 42. I bet we can find something about that in bugzilla somewhere. =/

    So, hopefully that explains the intended purpose of llvm.x86.seh.recoverfp, and why we might need to generalize it into something non-x86 specific. Maybe llvm.eh.recoverfp. Let me know if I can clarify anything else.
Tue, Jan 15, 11:40 AM
mgrang added a comment to D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.
In D53541#1356904, @rnk wrote:

What about the three stack pointer case of stack realignment plus a dynamic alloca? Typically this is the case where recoverfp is necessary.

@rnk Sorry, I missed your comment earlier. I am not sure what scenario the three stack pointer case is. Could you please give me a test case for it?

I think you just need a local variable with an alignment greater than the ABI provides, something like:

struct Foo {
  Foo();
  int x, y, z;
};
int filter(int);
void may_throw();
void seh_byval(int n) {
  Foo __declspec(align(32)) o;
  __try {
    may_throw();
  } __except(filter(o.x)) {
  }
}
Tue, Jan 15, 10:24 AM

Mon, Jan 14

mgrang committed rL351147: [COFF, ARM64] Add __byteswap intrinsics.
[COFF, ARM64] Add __byteswap intrinsics
Mon, Jan 14, 5:30 PM
mgrang committed rC351147: [COFF, ARM64] Add __byteswap intrinsics.
[COFF, ARM64] Add __byteswap intrinsics
Mon, Jan 14, 5:30 PM
mgrang closed D56685: [COFF, ARM64] Add __byteswap intrinsics.
Mon, Jan 14, 5:30 PM
mgrang added a comment to D56685: [COFF, ARM64] Add __byteswap intrinsics.

Verified that this compiles when both intrin.h and stdlib.h from the Microsoft SDK are included, in either order.

Mon, Jan 14, 5:24 PM
mgrang updated the diff for D56685: [COFF, ARM64] Add __byteswap intrinsics.
Mon, Jan 14, 5:24 PM
mgrang updated the diff for D56685: [COFF, ARM64] Add __byteswap intrinsics.
Mon, Jan 14, 4:53 PM
mgrang committed rC351137: [Sema] Change std::sort to llvm::sort.
[Sema] Change std::sort to llvm::sort
Mon, Jan 14, 3:50 PM
mgrang committed rL351137: [Sema] Change std::sort to llvm::sort.
[Sema] Change std::sort to llvm::sort
Mon, Jan 14, 3:49 PM
mgrang committed rC351135: [COFF, ARM64] Add __nop intrinsic.
[COFF, ARM64] Add __nop intrinsic
Mon, Jan 14, 3:30 PM
mgrang committed rL351135: [COFF, ARM64] Add __nop intrinsic.
[COFF, ARM64] Add __nop intrinsic
Mon, Jan 14, 3:30 PM
mgrang closed D56671: [COFF, ARM64] Add __nop intrinsic.
Mon, Jan 14, 3:30 PM
mgrang abandoned D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].

_bytswap intrinsics are added in D56685. Abandoning this patch.

Mon, Jan 14, 3:28 PM
mgrang created D56685: [COFF, ARM64] Add __byteswap intrinsics.
Mon, Jan 14, 3:27 PM
mgrang added a comment to D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].

I have implemented __nop intrinsics in https://reviews.llvm.org/D56620

Mon, Jan 14, 10:09 AM
mgrang created D56671: [COFF, ARM64] Add __nop intrinsic.
Mon, Jan 14, 10:09 AM

Fri, Jan 11

mgrang retitled D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64] from [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[short/long/uint64] to [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].
Fri, Jan 11, 4:27 PM
mgrang updated the diff for D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].
Fri, Jan 11, 4:26 PM
mgrang added a comment to D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].

Have you verified this matches MSVC? (IIRC the only reason we include stdlib.h on x86 is so we can define _mm_malloc.)

Fri, Jan 11, 4:25 PM
mgrang created D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].
Fri, Jan 11, 4:04 PM
mgrang updated the diff for D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.
Fri, Jan 11, 11:20 AM
mgrang added inline comments to D56463: [SEH] Pass the frame pointer from SEH finally to finally functions.
Fri, Jan 11, 10:32 AM

Thu, Jan 10

mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.

Added test cases for localescape and try-finally. Will add try-except test case soon.

Thu, Jan 10, 5:18 PM
mgrang accepted D56468: [EarlyIfConversion] Don't if-convert unconditional branches..

LGTM. I have verified that this patch resolves the problem in our custom code base.

Thu, Jan 10, 3:21 PM
mgrang added a comment to D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.
In D53541#1282900, @rnk wrote:

Updated the patch with the following changes:

  1. Emit llvm.x86.seh.recoverfp only for non-aarch64 targets. For aarch64 windows, the parent fp is always passed in x1. So we don't need a separate instrinsic to recover the fp.

What about the three stack pointer case of stack realignment plus a dynamic alloca? Typically this is the case where recoverfp is necessary.

Thu, Jan 10, 12:31 PM
mgrang added a child revision for D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic: D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Thu, Jan 10, 10:58 AM
mgrang added a parent revision for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally: D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.
Thu, Jan 10, 10:58 AM
mgrang updated the diff for D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.
Thu, Jan 10, 10:55 AM

Wed, Jan 9

mgrang committed rL350798: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
[AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc
Wed, Jan 9, 9:03 PM
mgrang closed D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Wed, Jan 9, 9:03 PM
mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Wed, Jan 9, 6:51 PM
mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Wed, Jan 9, 6:35 PM
mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Wed, Jan 9, 6:34 PM

Tue, Jan 8

mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Tue, Jan 8, 3:46 PM
mgrang added a comment to rLLDB350679: Change std::sort to llvm::sort to detect non-determinism..

Thanks for doing this. llvm::sort also takes a range-based argument. So I guess we can drop the begin/end from all arguments to llvm::sort

llvm::sort(names.begin(), names.end())  ==>  llvm::sort(names)
Tue, Jan 8, 3:36 PM
mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Tue, Jan 8, 11:35 AM
mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.

Addressed comments. The MCSymbol for the frame offset is now lowered in the assembler. D56037 needs to merge first.
I am now working on test cases. Will push them soon.

Tue, Jan 8, 11:10 AM

Mon, Jan 7

mgrang committed rL350606: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
[MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc.
Mon, Jan 7, 8:52 PM
mgrang closed D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Mon, Jan 7, 8:51 PM
mgrang updated the diff for D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Mon, Jan 7, 3:46 PM
mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Mon, Jan 7, 10:24 AM

Fri, Jan 4

mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Fri, Jan 4, 12:11 PM
mgrang added inline comments to D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Fri, Jan 4, 11:39 AM
mgrang added a comment to D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
In D56037#1346032, @rnk wrote:

Still needs tests, right?

Fri, Jan 4, 10:36 AM

Wed, Jan 2

mgrang added a comment to D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..

Ping2 for reviews please.

Wed, Jan 2, 11:27 AM

Wed, Dec 26

mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Wed, Dec 26, 1:07 PM
mgrang added a comment to D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..

Ping for reviews please.

Wed, Dec 26, 10:00 AM

Fri, Dec 21

mgrang added a parent revision for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally: D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Fri, Dec 21, 4:38 PM
mgrang added a child revision for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc: D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Fri, Dec 21, 4:38 PM
mgrang added a comment to D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.

I am not sure what kind of tests I should add for this patch. This is one of the patches needed for adding SEH support to LLVM (D53540).

Fri, Dec 21, 4:33 PM
mgrang created D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Fri, Dec 21, 4:32 PM
mgrang removed a child revision for D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic: D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Fri, Dec 21, 4:19 PM
mgrang edited parent revisions for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally, added: 1; removed: 1.
Fri, Dec 21, 4:19 PM
mgrang added a child revision for D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc.: D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Fri, Dec 21, 4:19 PM
mgrang updated the diff for D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Fri, Dec 21, 3:52 PM
mgrang updated the diff for D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Fri, Dec 21, 3:10 PM
mgrang retitled D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc. from [COFF, ARM64] Support resolving signed fixups for :abs_g0_s: etc. to [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Fri, Dec 21, 2:57 PM
mgrang created D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Fri, Dec 21, 2:55 PM

Dec 20 2018

mgrang accepted D55906: [MC] [AArch64] Correctly resolve ":abs_g1:3" etc..

LGTM. I have verified that this patch fixes the error if the label is defined before the use (mentioned in D55896).

Dec 20 2018, 11:26 AM
mgrang accepted D55896: [MC] [AArch64] Support resolving fixups for :abs_g0: etc..

LGTM.

Dec 20 2018, 11:25 AM

Dec 19 2018

mgrang added a reviewer for D55896: [MC] [AArch64] Support resolving fixups for :abs_g0: etc.: mgrang.
Dec 19 2018, 12:35 PM
mgrang added a comment to D55896: [MC] [AArch64] Support resolving fixups for :abs_g0: etc..

This doesn't seem to work if the label is defined before the use:

Dec 19 2018, 12:34 PM

Dec 18 2018

mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Dec 18 2018, 5:14 PM
mgrang added inline comments to D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Dec 18 2018, 5:10 PM
mgrang added inline comments to D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Dec 18 2018, 1:23 PM
mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Dec 18 2018, 1:17 PM

Dec 11 2018

mgrang committed rL348875: [COFF, ARM64] Emit COFF function header.
[COFF, ARM64] Emit COFF function header
Dec 11 2018, 10:39 AM
mgrang closed D55535: [COFF, ARM64] Emit COFF function header.
Dec 11 2018, 10:39 AM

Dec 10 2018

mgrang added a comment to D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.

@dmajor My updated change fixes the crash in your testcase.

Now, I am trying to build the SEH tests released by MS: https://github.com/Microsoft/windows_seh_tests. I started with XCPT4 tests. test5 is currently failing which I am triaging now.

@mgrang, the SEH fix still causes ARM64 COFF file crash when linking with CFG enabled (/guard:cf). Seems functions are not marked as IMAGE_SYM_DTYPE_FUNCTION in ARM64 COFF which was done in both x86 and arm32 COFF (see below 2 links).

https://github.com/llvm-mirror/llvm/blob/2cc0a7da876c1d8c32775b0119e1e15aaa759b9e/lib/Target/X86/X86AsmPrinter.cpp#L67

https://github.com/llvm-mirror/llvm/blob/2cc0a7da876c1d8c32775b0119e1e15aaa759b9e/lib/Target/ARM/ARMAsmPrinter.cpp#L148

Dec 10 2018, 5:23 PM