<font size=2 face="sans-serif">Hi all, </font><br><br><font size=2 face="sans-serif">I've been looking at this bug:<br></font><a href="https://bugs.llvm.org/show_bug.cgi?id=32611"><font size=2 color=blue face="sans-serif">https://bugs.llvm.org/show_bug.cgi?id=32611</font></a><font size=2 face="sans-serif"><br><br>The bug involves a function that is specified as not throwing anything
but in reality it does throw.<br></font><br><font size=2 face="sans-serif">void func() throw() {</font><br><font size=2 face="sans-serif">  throw 100;</font><br><font size=2 face="sans-serif">}<br><br>When this code is run we should see a call to __cxa_call_unexpected but
we do not. The reason is because the function does not generate the unwind
tables.<br>func() is marked with the nounwind attribute as is expected due to the
fact the user has told us it does not throw anything. However, that attribute
also blocks the generation of the unwind tables which are required for
the proper functioning of the call to unexpected. The solution is to also
use the attribute uwtable which forces the generation of the unwind tables.
</font><br><br><font size=2 face="sans-serif">Checking how this works on x86 I realised
that this works because -funwind-tables is on by default for x86 and therefore
adds the uwtable attribute to almost all of the functions being compiled.
</font><br><font size=2 face="sans-serif">I've added a patch <br></font><a href=https://reviews.llvm.org/D50908><font size=2 color=blue face="sans-serif">https://reviews.llvm.org/D50908</font></a><font size=2 face="sans-serif"><br>that does the same thing for PowerPC as is done on x86 and it fixes the
bug.<br><br>However, I feel like this solution adds a function attribute to a whole
set of functions where it is not needed. The vast majority of functions
that will now receive the uwtable attribute don't actually need it. </font><br><font size=2 face="sans-serif">Has anyone encountered an issue where
a function marked as nounwind actually requires unwind tables? Does anyone
know of a better solution for this?</font><br><br><font size=2 face="sans-serif">Thank you,</font><br><font size=2 face="sans-serif">Stefan</font><br><br><BR>