[LLVMdev] LLVMdev Digest, Vol 85, Issue 50

Peter Lawrence peterl95124 at sbcglobal.net
Thu Jul 28 14:22:46 PDT 2011


John,
            I'm still not sure what you're talking about, I have  
included the assembly
output from two compilations, one with a user explicit catch-all, one  
with only an
implicit cleanup, the DWARF Action Table and Types Table are  
absolutely identical,
as are the indexes used to reference the Action Table from the region  
maps.


-Peter Lawrence.

------------------------------------------------------------------------ 
---------------------------------------
extern void foo();
extern void print(const char *) __attribute__((nothrow));
void bar ()
{
         try {
                 foo();

         } catch (...) {
                 print("caught (...)\n");
         }
}

         .section        __TEXT,__gcc_except_tab
...
			;; CallSite Table
         .long   Ltmp0-Leh_func_begin0
         .long   Ltmp1-Ltmp0                     	<--- this region  
covers the call to foo
         .long   Ltmp2-Leh_func_begin0
         .byte   1                               			<--- this is it's  
Action Table index
...
			;; Action Table
         .byte   1
         .byte   0
			;; Types Table
         .long   0

------------------------------------------------------------------------ 
---------------------------------------
extern void foo();
extern void print(const char *) __attribute__((nothrow));
class Bob {
public:
         Bob() __attribute__((nothrow));
         ~Bob() __attribute__((nothrow));
};
void bar ()
{
         Bob A, B, C;

         foo();

         //~Bob C, B, Z;
}

         .section        __TEXT,__gcc_except_tab
...
			;; CallSite Table
         .long   Ltmp0-Leh_func_begin0
         .long   Ltmp1-Ltmp0				<--- this region covers the call to foo
         .long   Ltmp2-Leh_func_begin0
         .byte   1							<--- here is its Action Table index
...
			;; Action Table
         .byte   1
         .byte   0
			;; Types Table
         .long   0
------------------------------------------------------------------------ 
---------------------------------------







On Jul 28, 2011, at 1:00 PM, John McCall wrote:

> On Jul 28, 2011, at 8:41 AM, Peter Lawrence wrote:
>> In short the problem is that there is an ambiguity between a  
>> cleanup handler having
>> an Action Table entry that looks like
>> 	.byte	1		;; Type = 1 (ie #1 entry in Types Table)
>> 	.byte	0		;; Next = 0 (ie none, ie this is the list terminator for  
>> this try-statement)
>> together with a corresponding Types Table entry #1 that looks like
>> 	.long	0		;; RTTI pointer == NULL
>
> This is not a cleanup.  In the LSDAs for GCC's family of  
> personalities, cleanups
> by definition have a zero index into the types table.  I think I  
> see your confusion,
> though.
>
> LLVM-GCC and Clang used to share a bug where cleanups would sometimes
> be emitted as catch-alls as a workaround to a flaw in the inliner.   
> I fixed this
> flaw (or to be specific, I worked around it to the best of my  
> ability given the
> constraints of the broken eh.exception/eh.selector representation)  
> sometime
> in June, but part of the fix requires the front-end to emit  
> different code, and I've
> only updated Clang to do so because I can't touch dragonegg and  
> LLVM-GCC
> is dead.
>
> AFAIK, GCC never had this bug.
>
> John.




More information about the llvm-dev mailing list