This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/42506] New: remove useless '-fkeep-inline-functions' from gcc flags


One of users managed to add '-fkeep-inline-functions' flag to his CFLAGS and
managed to break build of our project. Simple example:
/* a.c: */
extern int foo(void);
static inline int unused_function(void) { return foo(); }
int main(void){ return 42; }

/* shell: */
$ /tmp:gcc a.c -o a # all ok
$ /tmp:LANG=C gcc -fkeep-inline-functions a.c -o a # breaks!
/tmp/cc65My6h.o: In function `unused_function':
a.c:(.text+0x5): undefined reference to `foo'
collect2: ld returned 1 exit status

Exploring this option a little more I've decided it's completely useless:

* as this option is only for 'static inline' functions - we always have
function's definition in translation unit.
* If inlining of all calls takes place - why we would need that unaddressable
junk, generated by that flag?
* If there is _no_ callers - why we would need that junk?
* If inlining does not take place - we get such behaviour w/o this flag

So, I propose to remove it.


-- 
           Summary: remove useless '-fkeep-inline-functions' from gcc flags
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: slyfox at inbox dot ru
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42506


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]