Related discussion: http://gcc.gnu.org/ml/gcc/2005-03/msg00181.html Related bug reports: Bug #20319, Bug #20321
This enhancement request that was part of #20321. Refiling as an explicit enhancement request. If an explicit section attribute is supplied for a static constant declaration (where the declaration is not otherwise referenced), do not eliminate the static constant definition. The rationale for this policy is that it is reasonable to assume that if the user is explicitly assigning the static constant to a named section, then he/she intends to use that static constant defintion, and does not want it eliminated from the executable image. -- Summary: RFE: explicit section attribute disables the unused static const optimization Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gary at intrepid dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23344