From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1849 invoked by alias); 23 Jun 2006 23:55:34 -0000 Received: (qmail 1830 invoked by uid 48); 23 Jun 2006 23:55:27 -0000 Date: Fri, 23 Jun 2006 23:59:00 -0000 Message-ID: <20060623235527.1829.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/27950] [4.2 regression] undefined reference when compiling valgrind 3.2.0 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "seongbae dot park at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-06/txt/msg02183.txt.bz2 List-Id: ------- Comment #5 from seongbae dot park at gmail dot com 2006-06-23 23:55 ------- Looks like this indeed is a duplicate of 27657. In toplev.c: 1013 cgraph_varpool_assemble_pending_decls (); ... 1040 (*debug_hooks->finish) (main_input_filename); dwarf2 finish ends up calling final.c:output_address w/ SYMREF to hacky_auxmap, which calls mark_decl_referenced() for hacky_auxmap declaration and is added to the pending list of varpool decls to be emitted. However, there's no call to cgraph_varpool_assemble_pending_decls() so even though hacky_auxmap is marked as needed, it won't get output. Calling cgraph_varpool_assemble_pending_decls() after debug hook finish can alleviate the linking problem by forcing the emission of hacky_auxmap (which seems unused except for debug information purpose, after uncalled static function elimination). However, the real cause is having const value marking for an unused (and hence removed) static variable - gcc seems to determine that auxmap is not used, after some removal of unused static functions and the analysis looks correct (though I didn't try hard to verify that). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27950