This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]