From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24768 invoked by alias); 10 Apr 2004 16:10:04 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 24760 invoked by uid 48); 10 Apr 2004 16:10:04 -0000 Date: Sat, 10 Apr 2004 18:16:00 -0000 From: "cesarb at nitnet dot com dot br" To: gcc-bugs@gcc.gnu.org Message-ID: <20040410161002.14909.cesarb@nitnet.com.br> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug optimization/14909] New: tail call optimization does not work with indirect call X-Bugzilla-Reason: CC X-SW-Source: 2004-04/txt/msg00892.txt.bz2 List-Id: (since I have nothing better to do, here's another sibcall bug) When compiling: void g(void (*f)(void)) { f(); } With: gcc -W -Wall -Os -fomit-frame-pointer -save-temps -c The result is: g: call *4(%esp) ret It should be: g: jmp *4(%esp) The same happens when returning something other than void (my original testcase used unsigned int). Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux Thread model: posix gcc version 3.3.3 (Debian 20040401) -- Summary: tail call optimization does not work with indirect call Product: gcc Version: 3.3.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: cesarb at nitnet dot com dot br CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14909