__attribute__((used)) is meant to be used only on VAR_DECLs that are TREE_STATIC, but the documentation does not say that. Thus fixed.
Ok? 2013-09-19 Marek Polacek <pola...@redhat.com> PR other/58467 * doc/extend.texi: Document that attribute used is meant to be used on variables with static storage duration. --- gcc/doc/extend.texi.mp 2013-09-19 16:22:16.214492101 +0200 +++ gcc/doc/extend.texi 2013-09-19 16:35:19.874041331 +0200 @@ -4891,8 +4891,9 @@ to be possibly unused. GCC does not pro variable. @item used -This attribute, attached to a variable, means that the variable must be -emitted even if it appears that the variable is not referenced. +This attribute, attached to a variable with static storage duration, means +that the variable must be emitted even if it appears that the variable is +not referenced. When applied to a static data member of a C++ class template, the attribute also means that the member is instantiated if the Marek