Created attachment 16106
Proposed patch.
$ cat x.cc
void f();
void g() {
try {
f();
} catch (...) {
}
}
$ clang --target=s390x-unknown-linux-gnu x.cc -S
$ cat x.s
[...]
stmg %r11, %r15, 88(%r15)
[...]
Only r11-r15 are saved and restored, despite r6 and r7 being modified by
landing pad entry. This can result in the function clobbering r6 and r7,
violating the ABI.
Proposed patch attached, but I'm not sure if it's the right place - some
generic code could be a better option, but I couldn't find an easy way to plumb
the register information from TargetLowering. What do you think?
Found while porting ASan to s390 (breaks throw_catch.cc test).
0001-SystemZ-Save-restore-r6-and-r7-if-function-contains-.patch
(1860 bytes, text/plain)