public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/9079: Inline constant function pointers
@ 2003-03-22 18:24 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-03-22 18:24 UTC (permalink / raw)
  To: 173513, gcc-bugs, gcc-prs, nobody, vectro

Synopsis: Inline constant function pointers

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Sat Mar 22 18:24:45 2003
State-Changed-Why:
    Confirmed on all branches

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9079


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

* optimization/9079: Inline constant function pointers
@ 2002-12-28  3:26 Matthias Klose
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Klose @ 2002-12-28  3:26 UTC (permalink / raw)
  To: gcc-gnats, debian-gcc


>Number:         9079
>Category:       optimization
>Synopsis:       Inline constant function pointers
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 28 03:26:05 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Ian Turner <vectro@pipeline.com>
>Release:        3.2.1 (Debian) (Debian unstable)
>Organization:
The Debian Project
>Environment:
System: Debian GNU/Linux (unstable)
Architecture: i686
host: i386-linux
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.2 20021212 (Debian prerelease)
>Description:
[ Reported to the Debian BTS as report #173513.
  Please CC 173513@bugs.debian.org on replies.
  Log of report can be found at http://bugs.debian.org/173513 ]
	

Currently GCC will not inline a call of a function pointer that is known 
at compile time. For example, the following code will still result in 
the instruction "call funk" when run with -finline-functions on i386:

#include <stdio.h>

static char* funk() {
  return "Hello World.\n";
}

static void funky(char*(*func)()) {
  printf("%s", func());
}

void main() {
  funky(funk);
}

Although the call to funky is inlined, the call to funk is not, because 
in the source code it appears as a call of a function pointer. But as a 
consequence of funky being inlined, it would be possible to inline funk 
as well.
>How-To-Repeat:
	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-03-22 18:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-22 18:24 optimization/9079: Inline constant function pointers bangerth
  -- strict thread matches above, loose matches on Subject: below --
2002-12-28  3:26 Matthias Klose

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).