================
@@ -0,0 +1,57 @@
+; RUN: llc -mtriple thumbv7-windows-msvc -o - %s
+; XFAIL: *
+
+; FIXME: C++ EH is not supported on thumbv7-windows-msvc yet.
+
+; FIXME: Windows SEH for armv7 does not preserve the frame register R11 in
+; handlers. This may affect C++ EH when accessing arguments on the stack in
+; functions with stack realignment.
+
+; C++ source:
+; struct X { int x[100]; };
+; void f(X x, void (*a)(), void (*g)(int*)) {
+;     alignas(64) int aligned;
+;     try {
+;         a();
+;     } catch (...) {
+;         g(&x.x[11]);
+;     }
+; }
+
+%struct.X = type { [100 x i32] }
+
+define void @"?f@@YAXUX@@P6AXXZP6AXPAH@Z@Z"(ptr byval(%struct.X) align 4 %x, 
ptr %a, ptr %g) personality ptr @__CxxFrameHandler3 {
----------------
efriedma-quic wrote:

We assume a catchpad in an SEH function is an `__except`, which doesn't make a 
separate function, right.  This should work, though (build with optimizations 
enabled):

```
struct X { int x[100]; };
void g(int*, int*) noexcept;
void f(X x, void (*a)()) {
    alignas(64) int aligned;
    struct A {
        X &x;
        int &aligned;
        ~A() {g(&x.x[11], &aligned);}
    } obj = {x, aligned};
    a();
}
```

Really, the reason I've been pushing this a bit is that I'm a little concerned 
that there might be some way to access local variables that doesn't go through 
llvm.localrecover.  (There's nothing fundamentally stopping it, it's just not 
easy to trigger with the transforms LLVM currently runs.)

https://github.com/llvm/llvm-project/pull/184953
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to