While looking into PR 36297, I found this interesting missed optimization, it only happens with linked once functions. Testcase: template <int a> int f(void) { static int t = a; return t; }
int g(void) { return f<1>(); } We should produce return 1 for both functions but currently we reference f<1>::t . -- Summary: missed "inlining" of static untouched variable in linked once function Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36352