This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
- From: "sxanth at ceid dot upatras dot gr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Dec 2004 22:25:53 -0000
- Subject: [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
- References: <20021228032605.9079.173513@bugs.debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From sxanth at ceid dot upatras dot gr 2004-12-13 22:25 -------
This is present in 3.4 too
--------------------------------------------
static inline int foo ()
{
return 100;
}
typedef int (*fptr)();
static const fptr a [] = { foo };
static inline int call (int i)
{
return a [i]();
}
static inline int call2 (fptr f)
{
return f();
}
static const fptr F = foo;
int main ()
{
return call (0) + call2 (foo) + F() +foo();
}
---------------------------------------------------
Here only F() and foo() are added at compile time
but it would be better if gcc just returned 400 w/o any other code.
Please fix!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079