Testcase: /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-optimized" } */
static const int conststaticvariable; int f(void) { return conststaticvariable; } /* There should be no reference to conststaticvariable as we should have inlined the 0. */ /* { dg-final { scan-tree-dump-times "conststaticvariable" o "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ -- Summary: Store CCP will not inline static const variable which is default initialized Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal 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=35402