[PATCH] Propagate -fno-unwind-tables to EHABI

Logan Chien tzuhsiang.chien at gmail.com
Mon Mar 17 10:58:17 PDT 2014

Comment at: test/CodeGen/ARM/ehabi.ll:283
@@ -282,3 +282,3 @@
-define void @test4() nounwind {
+define void @test4() uwtable nounwind {
Renato Golin wrote:
> Logan Chien wrote:
> > Is this change of test case correct?  IIRC, .cantunwind shouldn't be emitted when the function has uwtable attribute.
> > 
> > I remembered that Rafael had argued for this **feature** in the mailing list.
> You need to have unwind tables to emit .cantunwind, so I'm not sure what do you mean. Since this function is a leaf function (and it doesn't throw), it cannot possible unwind, but it still needs the tables. It's still possible to unwind it in debug/profiling modes, though.
> Right now, all functions in x86_64 and ARM will have uwtable (unless -fno-unwind-tables), and all non-throwing functions will have nounwind, so that can't be a feature, at least not right now.
Although, the meaning of `uwtable` is not precisely defined in the language spec, based on the existing code, I believe `uwtable` means the ability to unwind to previous frame.  The function with `uwtable` attribute should encoding the stack information properly so that the stack unwinder can pass through the frame without problems.  However, the cantunwind directive simply stops the stack unwinder.

You can compare the code with and without this change and you will know what I mean.

I guess changing ARMException.cpp line 89 to:

    if (!shouldEmitEH)

And remove line 85, can keep this test case unchanged.


More information about the llvm-commits mailing list