This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/3713] Pointers to functions or member functions are not folded or inlined
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jul 2005 21:54:27 -0000
- Subject: [Bug tree-optimization/3713] Pointers to functions or member functions are not folded or inlined
- References: <20010717101600.3713.philippeb@videotron.ca>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-04 21:54 -------
Actually the testcase above is not really valid.
The below testcase is more correct as A::p cannot be inlined as it has its address taken (stupid bug in
the C++ front-end really).
But here is a better testcase:
struct A
{
void foo()
{
}
};
int main()
{
void (A::* const p)() = & A::foo;
A a;
(a.*p)();
}
---- cut ---
D.1749 = (int) foo;
if ((D.1749 & 1) != 0) goto <L0>; else goto <L5>;
hmm, we need to know the alignment of a function, which is weird. Why is the C++ front-end
producing code like this, oh well.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3713