/* { dg-do run { target fpic } } */ /* { dg-options "-O0 -fpic" } */
typedef int (*fn) (void); static inline int foo (void) { return 1; } fn test (void) { return foo; } int main (void) { fn f = test (); return f () != 1; } doesn't link on i386/x86_64 in 4.1 (regression from 4.0) - function foo isn't marked as referenced and therefore not emitted. This was fixed on the trunk in PR25758. -- Summary: [4.1 regression] -O0 -fpic link failure Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org GCC target triplet: i386-linux, x86_64-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27758