https://llvm.org/bugs/show_bug.cgi?id=27102

            Bug ID: 27102
           Summary: r6/r7 are not saved/restored when modified only by
                    landing pad entry
           Product: libraries
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: SystemZ
          Assignee: unassignedb...@nondot.org
          Reporter: koria...@0x04.net
                CC: llvm-bugs@lists.llvm.org, uweig...@de.ibm.com
    Classification: Unclassified

Created attachment 16106
  --> https://llvm.org/bugs/attachment.cgi?id=16106&action=edit
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).

-- 
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

Reply via email to