From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31656 invoked by alias); 24 Jan 2004 01:48:40 -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 31649 invoked by uid 48); 24 Jan 2004 01:48:40 -0000 Date: Sat, 24 Jan 2004 01:48:00 -0000 From: "dje at transmeta dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20040124014837.13842.dje@transmeta.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/13842] New: static inline erroneously emitted X-Bugzilla-Reason: CC X-SW-Source: 2004-01/txt/msg03042.txt.bz2 List-Id: static inline functions are not emitted if they are not referenced. The following case may fall on the boundary, however it use to work (e.g. in gcc 2.96) and it works in gcc 3.4, so I'm guessing this is a regression in the 3.3 branch. I was able to recreate the problem with the current head of the gcc-3_3-branch branch. Consider: static inline int foo (void); static inline int foocaller (void) { return foo (); } extern int bar (void); extern int blah; static inline int foo (void) { return bar (); } int lala (void) { return blah; } bash$ gcc-3.3.3 -c -O2 -fno-inline foo.c bash$ nm foo.o U bar U blah 00000000 t foo 0000000c T lala Note that `foo' has been emitted. [which isn't that big a deal except that an undefined reference has also been emitted that didn't get emitted before] Again, given the presence of -fno-inline, whether y'all want to declare this a bug or not is up for discussion I guess. However, this use to work, and it works in the gcc 3.4 branch, thus I'm guessing this is a regression. [where "works" means `foo' and the undefined reference to `bar' do not get emitted] -- Summary: static inline erroneously emitted Product: gcc Version: 3.3.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dje at transmeta dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13842