public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/28850]  New: missed call -> jmp transformation; redundant unwind stuff.
@ 2006-08-25 20:40 pluto at agmk dot net
  2006-08-25 21:52 ` [Bug tree-optimization/28850] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pluto at agmk dot net @ 2006-08-25 20:40 UTC (permalink / raw)
  To: gcc-bugs

$ cat fake_bomber.cpp

struct bomber
{
        bomber() : bum( false ) { }
        ~bomber() { if ( bum ) throw 0; }  // this will never throw
private:
        bool bum;
};

void zoo() { }

void bar( void ( *f )() )
{
#ifndef CALL2JMP
        bomber b; // fake bomber
#endif
        f();
}

void foo()
{
#ifndef CALL2JMP
        bomber b; // fake bomber
#endif
        bar( &zoo );
}

int main()
{
        foo();
        return 0;
}

$ g++ fake_bomber.cpp -o fake_bomber -O3 -fno-rtti --save-temps

zoo():
        rep ; ret

bar(void (*)()):
        subq    $8, %rsp
        call    *%rdi
        addq    $8, %rsp
        ret
        movq    %rax, %rdi
        call    _Unwind_Resume

foo():
        subq    $8, %rsp
        movl    zoo(), %edi
        call    bar(void (*)())
        addq    $8, %rsp
        ret
        movq    %rax, %rdi
        call    _Unwind_Resume

main:
        subq    $8, %rsp
        call    foo()
        xorl    %eax, %eax
        addq    $8, %rsp
        ret

$ g++ fake_bomber.cpp -o fake_bomber -O3 -fno-rtti --save-temps -DCALL2JMP

zoo():
        rep ; ret

bar(void (*)()):
        movq    %rdi, %r11
        jmp     *%r11

foo():
        rep ; ret

main:
        xorl    %eax, %eax
        ret


-- 
           Summary: missed call -> jmp transformation; redundant unwind
                    stuff.
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
GCC target triplet: x86-64-linux


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-29 13:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-25 20:40 [Bug tree-optimization/28850] New: missed call -> jmp transformation; redundant unwind stuff pluto at agmk dot net
2006-08-25 21:52 ` [Bug tree-optimization/28850] " rguenth at gcc dot gnu dot org
2006-08-25 21:59 ` [Bug tree-optimization/28850] missed call -> jmp transformation; redundant unwind stuff with empty finally pinskia at gcc dot gnu dot org
2006-08-26 10:07 ` rguenth at gcc dot gnu dot org
2009-03-29 13:32 ` hubicka at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).