[Bug java/49258] -ffunction-sections and --gc-sectinons have no effect at gcj

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Apr 9 19:41:00 GMT 2012


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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-04-09 19:40:41 UTC ---
(In reply to comment #6)
> and i test a c++ file,it will remove the unused funcitons "notused":

But that is not the same as there is no vtable for hello.
Try:
#include <iostream>

class hello
{
public:
        hello()
        {
        }
        virtual void notused()
        {
                std::cout << "not used";
        }
        virtual void used()
        {
                std::cout << "used";
        }
        virtual ~hello()
        {
        }
}hi;

int main()
{       hello t;
        t.used();
        return 0;
}

And see the result.



More information about the Java-prs mailing list