From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6491 invoked by alias); 9 Apr 2012 11:15:13 -0000 Received: (qmail 6473 invoked by uid 22791); 9 Apr 2012 11:15:11 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_GC X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Apr 2012 11:14:58 +0000 From: "licheng.1212 at gmail dot com" To: java-prs@gcc.gnu.org Subject: [Bug java/49258] -ffunction-sections and --gc-sectinons have no effect at gcj Date: Mon, 09 Apr 2012 11:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: java X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: licheng.1212 at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2012-q2/txt/msg00020.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49258 --- Comment #6 from licheng.1212 at gmail dot com 2012-04-09 11:14:56 UTC --- (In reply to comment #5) > (In reply to comment #4) > > Yes,but why we can't remove the function notused() form vtable, since this > > function will never used. > > How can you tell? Without the full exectuable and knowing the entry point, > there is no way (-fwhole-program can help but it becomes a turning machine at > that point). class hello{ public void notused() { System.out.println("not used"); } public static void main(String argv[]) { System.out.println("Hello"); } } this is a full execlutable program,and it hava only one entry point "main"! and i test a c++ file,it will remove the unused funcitons "notused": [licheng@Soft04 ~]$ cat hello.cpp #include class hello { public: hello() { } void notused() { std::cout << "not used"; } void used() { std::cout << "used"; } ~hello() { } }hi; int main() { hello t; t.used(); return 0; } [licheng@Soft04 ~]$