First Last Prev Next    No search results available
Details
: [llvmgcc] C front-end does not compile "extern inline" in...
Bug#: 182
: tools
: llvm-gcc
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.0
: P2
: minor
: 1.2

:
: code-quality
:
: 202
  Show dependency tree - Show dependency graph
People
Reporter: Chris Lattner <sabre@nondot.org>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2003-12-14 18:06
llvmgcc currently compiles "extern inline" functions into "weak" linkage,
instead of linkonce linkage, preventing the optimizer from deleting the bodies
of unreferenced functions.

Testcase here: test/Regression/CFrontend/2003-12-14-ExternInlineSupport.c.tr

Another testcase:
--- test.c
#include <gmp.h>
---
$ llvmgcc test.c -c -o - | llvm-dis

-Chris
------- Comment #1 From Chris Lattner 2004-01-08 10:56:25 -------
Here's a fix:

$ diff -u llvm-expand.c~ llvm-expand.c
--- llvm-expand.c~      2003-12-14 12:25:33.000000000 -0600
+++ llvm-expand.c       2004-01-08 10:53:45.000000000 -0600
@@ -6164,7 +6164,7 @@
   if (!TREE_PUBLIC(subr) || lang_hooks.llvm_is_in_anon(subr))
     Fn->Linkage = L_Internal;
   else if (DECL_COMDAT(subr) || 
-           /* Are these two necessary?? */
+           (DECL_DECLARED_INLINE_P(subr) && DECL_EXTERNAL(subr)) ||
            (DECL_DECLARED_INLINE_P(subr) && DECL_ONE_ONLY(subr))) {
     Fn->Linkage = L_LinkOnce;
   } else if (DECL_WEAK(subr) || DECL_DECLARED_INLINE_P(subr) ||

First Last Prev Next    No search results available