From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19477 invoked by alias); 3 Feb 2004 08:39:19 -0000 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 Received: (qmail 19423 invoked by uid 48); 3 Feb 2004 08:39:15 -0000 Date: Tue, 03 Feb 2004 08:39:00 -0000 Message-ID: <20040203083915.19422.qmail@sources.redhat.com> From: "ebotcazou at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040120110040.13768.igodard@pacbell.net> References: <20040120110040.13768.igodard@pacbell.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13768] [3.4/3.5 Regression] -funit-at-a-time compiles unused inline function X-Bugzilla-Reason: CC X-SW-Source: 2004-02/txt/msg00298.txt.bz2 List-Id: ------- Additional Comments From ebotcazou at gcc dot gnu dot org 2004-02-03 08:38 ------- With -funit-at-a-time, the C++ front-end (decl2.c:maybe_emit_vtables) emits the vtable for struct X, while it doesn't do so without -funit-at-a-time. The difference in the behaviour boils down to this macro in cp-tree.h: /* DECL_NEEDED_P holds of a declaration when we need to emit its definition. This is true when the back-end tells us that the symbol has been referenced in the generated code. If, however, we are not generating code, then it is also true when a symbol has just been used somewhere, even if it's not really needed. We need anything that isn't comdat, but we don't know for sure whether or not something is comdat until end-of-file. */ #define DECL_NEEDED_P(DECL) \ ((at_eof && TREE_PUBLIC (DECL) && !DECL_COMDAT (DECL)) \ || (DECL_ASSEMBLER_NAME_SET_P (DECL) \ && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL))) \ || (((flag_syntax_only || flag_unit_at_a_time) && TREE_USED (DECL)))) According to the comment, it seems that -funit-at-a-time behaves like -fsyntax-only, that is it may emit DECLs that are not really needed. -- What |Removed |Added ---------------------------------------------------------------------------- Component|optimization |c++ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13768