1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
llvm-mirror/lib
Petar Jovanovic 73dbdc3960 Add cfi instr for CFA calculation when movpc is expanded to call and pop
This fixes the issue of wrong CFA calculation in the following case:

0x08048400 <+0>:	push   %ebx
0x08048401 <+1>:	sub    $0x8,%esp
0x08048404 <+4>:	**call   0x8048409 <test+9>**
0x08048409 <+9>:	**pop    %eax**
0x0804840a <+10>:	add    $0x1bf7,%eax
0x08048410 <+16>:	mov    %eax,%ebx
0x08048412 <+18>:	call   0x80483f0 <bar>
0x08048417 <+23>:	add    $0x8,%esp
0x0804841a <+26>:	pop    %ebx
0x0804841b <+27>:	ret

The highlighted instructions are a product of movpc instruction. The call
instruction changes the stack pointer, and pop instruction restores its
value. However, the rule for computing CFA is not updated and is wrong on
the pop instruction. So, e.g. backtrace in gdb does not work when on the pop
instruction. This adds cfi instructions for both call and pop instructions.

cfi_adjust_cfa_offset** instruction is used with the appropriate offset for
setting the rules to calculate CFA correctly.

Patch by Violeta Vukobrat.

Differential Revision: http://reviews.llvm.org/D14021

llvm-svn: 252176
2015-11-05 17:19:59 +00:00
..
Analysis Fix LoopAccessAnalysis when potentially nullptr check are involved 2015-11-05 05:49:43 +00:00
AsmParser AsmParser: Remove implicit ilist iterator conversions, NFC 2015-10-20 01:12:49 +00:00
Bitcode Fix Abbrev emission in WriteIdentificationBlock 2015-11-05 00:25:03 +00:00
CodeGen Fix some Clang-tidy modernize warnings, other minor fixes. 2015-11-04 22:32:32 +00:00
DebugInfo [LLVMSymbolize] Reduce indentation by using helper function. NFC. 2015-11-04 00:30:26 +00:00
ExecutionEngine RuntimeDyld: fix -Wtype-limits 2015-11-05 06:24:09 +00:00
Fuzzer [libFuzzer] print a bit fewer lines 2015-11-05 01:19:42 +00:00
IR [IR] Add bounds checking to dataOperandHasImpliedAttr 2015-11-05 01:53:26 +00:00
IRReader
LibDriver [Option] Use an ArrayRef to store the Option Infos in OptTable. NFC 2015-10-21 16:30:42 +00:00
LineEditor
Linker [ThinLTO] Always set linkage type to external when converting alias 2015-11-04 16:01:16 +00:00
LTO
MC Fix pr24832. 2015-11-05 00:10:08 +00:00
Object [ELF] elfiamcu triple should imply e_machine == EM_IAMCU 2015-11-04 11:21:50 +00:00
Option [Option] Use an ArrayRef to store the Option Infos in OptTable. NFC 2015-10-21 16:30:42 +00:00
Passes [PM] Port StripDeadPrototypes to the new pass manager 2015-10-30 23:28:12 +00:00
ProfileData [PGO] Use template file to define runtime structures 2015-11-05 00:47:26 +00:00
Support Fix a signed/unsigned mismatch warning; NFC. 2015-11-05 14:22:56 +00:00
TableGen [TblGen] ArrayRefize TGParser. No functional change intended. 2015-10-24 12:46:45 +00:00
Target Add cfi instr for CFA calculation when movpc is expanded to call and pop 2015-11-05 17:19:59 +00:00
Transforms [SimplifyCFG] Tweak heuristic for merging conditional stores 2015-11-05 08:40:19 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile