[Bug tree-optimization/3713] Pointers to functions or member functions are not folded or inlined

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Jul 4 21:54:00 GMT 2005


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



More information about the Gcc-bugs mailing list