llvm-project/llvm/test
Joseph Tremoulet b41632bf0f [Inliner/WinEH] Honor implicit nounwinds
Summary:
Funclet EH tables require that a given funclet have only one unwind
destination for exceptional exits.  The verifier will therefore reject
e.g. two cleanuprets with different unwind dests for the same cleanup, or
two invokes exiting the same funclet but to different unwind dests.
Because catchswitch has no 'nounwind' variant, and because IR producers
are not *required* to annotate calls which will not unwind as 'nounwind',
it is legal to nest a call or an "unwind to caller" catchswitch within a
funclet pad that has an unwind destination other than caller; it is
undefined behavior for such a call or catchswitch to unwind.

Normally when inlining an invoke, calls in the inlined sequence are
rewritten to invokes that unwind to the callsite invoke's unwind
destination, and "unwind to caller" catchswitches in the inlined sequence
are rewritten to unwind to the callsite invoke's unwind destination.
However, if such a call or "unwind to caller" catchswitch is located in a
callee funclet that has another exceptional exit with an unwind
destination within the callee, applying the normal transformation would
give that callee funclet multiple unwind destinations for its exceptional
exits.  There would be no way for EH table generation to determine which
is the "true" exit, and the verifier would reject the function
accordingly.

Add logic to the inliner to detect these cases and leave such calls and
"unwind to caller" catchswitches as calls and "unwind to caller"
catchswitches in the inlined sequence.

This fixes PR26147.


Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: alexcrichton, llvm-commits

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

llvm-svn: 258273
2016-01-20 02:15:15 +00:00
..
Analysis Revert "[ValueTracking] Understand more select patterns in ComputeKnownBits" 2016-01-14 15:49:32 +00:00
Assembler Fix constant folding of constant vector GEPs with undef or null as pointer argument. 2016-01-19 16:34:31 +00:00
Bindings Deprecate a few C APIs. 2015-12-18 23:46:42 +00:00
Bitcode [WinEH] Verify unwind edges against EH pad tree 2016-01-10 04:28:38 +00:00
BugPoint [bugpoint] Add a named metadata (+their operands) reducer 2015-11-06 00:12:50 +00:00
CodeGen AMDGPU/SI: Prevent the DAGCombiner from creating setcc with i1 inputs 2016-01-20 00:13:22 +00:00
DebugInfo [DwarfDebug] Don't merge DebugLocEntries if their pieces overlap 2016-01-16 01:15:32 +00:00
Examples
ExecutionEngine [JIT] Add small-code model test for ELF. 2016-01-18 21:14:12 +00:00
Feature [WinEH] Verify unwind edges against EH pad tree 2016-01-10 04:28:38 +00:00
FileCheck
Instrumentation [sanitizer] [msan] Fix origin store of array types 2016-01-11 19:55:27 +00:00
Integer
JitListener Fix several accidental DOS line endings in source files 2016-01-03 17:22:03 +00:00
LTO [LTO] Restore original linkage of externals prior to splitting 2016-01-18 23:24:54 +00:00
LibDriver
Linker Reapply r257105 "[Verifier] Check that debug values have proper size" 2016-01-15 00:46:17 +00:00
MC [MC, COFF] Add .reloc support for WinCOFF 2016-01-19 23:05:27 +00:00
Object [llvm-readobj][ELF] Teach llvm-readobj to show dynamic relocation in REL format 2016-01-16 22:40:09 +00:00
Other Recommit r256952 "Filtering IR printing for print-after-all/print-before-all" 2016-01-06 22:55:03 +00:00
SymbolRewriter
TableGen Add test cases that will show the bug that was fixed in r256725. 2016-01-13 07:53:11 +00:00
Transforms [Inliner/WinEH] Honor implicit nounwinds 2016-01-20 02:15:15 +00:00
Unit
Verifier [WinEH] Fix catchpad pred verification 2016-01-10 04:32:03 +00:00
YAMLParser
tools Add to the split module utility an SCC based method which allows not to globalize any local variables. 2016-01-18 21:07:13 +00:00
.clang-format
CMakeLists.txt Introduce sanstats tool and llvm::CreateSanitizerStatReport function. 2016-01-16 00:31:11 +00:00
Makefile check-llvm: Tweak the feature "timestamps" for autoconf. 2015-12-21 08:46:12 +00:00
Makefile.tests
TestRunner.sh
lit.cfg Introduce sanstats tool and llvm::CreateSanitizerStatReport function. 2016-01-16 00:31:11 +00:00
lit.site.cfg.in Make WinCOFFObjectWriter.cpp's timestamp writing not use ENABLE_TIMESTAMPS 2016-01-06 19:05:19 +00:00