LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 1410 - llc -enable-eh moves invoke calls out of the eh region
Summary: llc -enable-eh moves invoke calls out of the eh region
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: unspecified
Hardware: Other Linux
: P normal
Assignee: Anton Korobeynikov
URL:
Keywords:
Depends on:
Blocks: 870
  Show dependency tree
 
Reported: 2007-05-10 14:33 PDT by Duncan Sands
Modified: 2010-02-22 12:45 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments
testcase (16.13 KB, text/plain)
2007-05-10 14:34 PDT, Duncan Sands
Details
Additional fix (2.35 KB, patch)
2007-05-11 09:26 PDT, Duncan Sands
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Sands 2007-05-10 14:33:41 PDT
$ 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!
Comment 1 Duncan Sands 2007-05-10 14:34:12 PDT
Created attachment 840 [details]
testcase
Comment 2 Anton Korobeynikov 2007-05-10 16:12:02 PDT
The reason of such "bad" thing is that current EH implementation doesn't support
landing pads with multiple predecessors! :)
Comment 3 Anton Korobeynikov 2007-05-10 17:37:25 PDT
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.
Comment 4 Duncan Sands 2007-05-11 09:26:54 PDT
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.
Comment 6 Duncan Sands 2007-05-13 13:00:59 PDT
The original failing code now works, so let's consider this fixed.