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: "cesarb at nitnet dot com dot br" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 May 2004 00:10:03 -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 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