We don't remove unused static function variables.  Take the following code:
static int iii;
void f(int i)
{
  i = 0;
  if(i)
  {
   static int ii;
   const char *c = __FUNCTION__;
   iii = 0;
  }
}

There should be no ii or reference to __FUNCTION__.  We do remove the refence 
to iii though.

-- 
           Summary: Removing unused static function variables
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22242

Reply via email to