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

cesarb at nitnet dot com dot br gcc-bugzilla@gcc.gnu.org
Fri May 21 01:50:00 GMT 2004


------- Additional Comments From cesarb at nitnet dot com dot br  2004-05-20 00:10 -------
I just hit this bug in a hairy piece of code which I reduced to the testcase
below (a should compile to the same thing as expected).

It's the same as this bug but with two layers of indirection instead of one.

#define inline inline __attribute__((always_inline))
#define regparm __attribute__((regparm(3)))
extern void regparm f(void);
static inline void regparm e(void)
{
	f();
}
static inline void regparm d(void)
{
	f();
}
static inline void regparm c(int x, void (regparm *p1)(void), void (regparm
*p2)(void))
{
	if (x)
		p1();
	else
		p2();
}
static inline void regparm b(int x, void (regparm *p)(int x, void (regparm
*p1)(void), void (regparm *p2)(void)))
{
	p(x, d, e);
}
void regparm a(int x)
{
	b(x, c);
}
void regparm expected(int x __attribute__((unused)))
{
	f();
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cesarb at nitnet dot com dot
                   |                            |br


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



More information about the Gcc-bugs mailing list