[Bug rtl-optimization/36419] [4.3 Regression] Wrong unwind info with -Os -fasynchronous-unwind-tables

jakub at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Jun 2 14:09:00 GMT 2008



------- Comment #2 from jakub at gcc dot gnu dot org  2008-06-02 14:08 -------
Important correction, it works with:
-m32 -Os -fpic -fno-asynchronous-unwind-tables
but doesn't with:
-m32 -Os -fpic -fasynchronous-unwind-tables
which generates identical .text, but different unwind info.

The code in between that jmp .L542 and .L542: looks broken:

.LCFI2090:
        call    rtl_uString_release@PLT
        addl    $16, %esp
.LCFI2091:
        jmp     .L542
.L543:
.L621:
        # basic block 13
.L544:
        movl    %eax, %edi
        subl    $12, %esp
.LCFI2092:
        leal    -32(%ebp), %eax
        movl    %edx, %esi
        pushl   %eax
.LCFI2093:
        call    _ZN3com3sun4star3uno9ReferenceINS2_10XInterfaceEED1Ev@PLT
        jmp     .L545
.LCFI2094:
.L622:
        # basic block 14
        movl    %eax, %edi
        movl    %edx, %esi
.L545:
        # basic block 15
.L623:
        subl    $12, %esp
.LCFI2095:
        pushl   -28(%ebp)
.LCFI2096:
        call    rtl_uString_release@PLT
        cmpl    $1, %esi
        jne     .L592
        # basic block 16
.L546:
        subl    $12, %esp
.LCFI2097:
        pushl   %edi
.LCFI2098:
        call    __cxa_begin_catch@PLT
        addl    $16, %esp
.LCFI2099:
.LEHB94:
        call    __cxa_end_catch@PLT
.LEHE94:
.L542:
        # basic block 17
        cmpl    $0, -20(%ebp)

Both .L621 and .L622 are landing pads, so I believe args_size should be 0
at those points (and the dwarf2out code even clears args_size on BARRIERs).
call    _ZN3com3sun4star3uno9ReferenceINS2_10XInterfaceEED1Ev@PLT
is done with args_size 16, which looks correct, but it then jumps to .L545
without addl 16, %esp which would be IMNSHO expected to get stack pointer back
to
args_size 0 level, and .L545 is after barrier with no stack changes.
When entering the .L622 landing pad call    rtl_uString_release@PLT
is done with correct args_size 16, but the following call   
__cxa_begin_catch@PLT is done with args_size 32, eventhough the call only has
one parameter and so should be 16.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36419



More information about the Gcc-bugs mailing list