$ llvm-as eh5.ll $ llc -enable-eh eh5.bc Inspect eh5.s to see that the first two invokes of @__gnat_rcheck_07 have been moved out of line, and out of any eh region!
Created attachment 840 [details] testcase
The reason of such "bad" thing is that current EH implementation doesn't support landing pads with multiple predecessors! :)
I hope this fixes the bug: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049489.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049488.html Duncan, could you plase verify? And if everything is ok, close the bug.
Created attachment 842 [details] Additional fix The code currently wrongly assumes that "TType base offset" and "Call-site table length" take up one byte. This patch fixes that. The trickiest bit is that the amount of alignment to insert before the ttypes depends on the size of TType base offset, while TType base offset depends on the amount of alignment. Oops! Gcc's except.c does a loop in which the offset is updated based on the alignment, the alignment is recalculated, rinse and repeat, until it stabilizes the offset and alignment stop changing their values. I hope they proved that this always converges! I've taken a different approach which is much simpler: rather than placing alignment padding between the actions and the ttypes, I add some padding at the start of the table instead, before LPStart format. This avoids the mutual dependence problem altogether.
Applied in: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049536.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049537.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049538.html Can we close this bug?
The original failing code now works, so let's consider this fixed.