Prevent register coalescing in functions whith setjmp
authorDiogo Sampaio <diogo.sampaio@arm.com>
Fri, 15 May 2020 21:21:13 +0000 (22:21 +0100)
committerDiogo Sampaio <diogo.sampaio@arm.com>
Fri, 15 May 2020 23:36:34 +0000 (00:36 +0100)
commit6c68f75ee4d94710821b0d5041e1fb0441db144e
tree29a75de2e40e62b4f00abf4dc58f8883583e20f7
parent0c2c6fce07e43b90e2bc44004710e10192ab3b83
Prevent register coalescing in functions whith setjmp

Summary:
In the the given example, a stack slot pointer is merged
between a setjmp and longjmp. This pointer is spilled,
so it does not get correctly restored, addinga undefined
behaviour where it shouldn't.

Change-Id: I60ec010844f2a24ce01ceccf12eb5eba5ab94abb

Reviewers: eli.friedman, thanm, efriedma

Reviewed By: efriedma

Subscribers: MatzeB, qcolombet, tpr, rnk, efriedma, hiraditya, llvm-commits, chill

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77767
llvm/lib/CodeGen/RegisterCoalescer.cpp
llvm/test/CodeGen/ARM/no-register-coalescing-in-returnsTwice.mir [new file with mode: 0644]
llvm/test/CodeGen/X86/speculative-load-hardening-call-and-ret.ll