This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/9059] unused arrays not optimized away


------- Additional Comments From steven at gcc dot gnu dot org  2004-05-17 10:47 -------
Ehm, pass_remove_useless_vars _is_ called, but there is no variable annotation
for unused variables, so:

  /* Remove all unused, unaliased temporaries.  Also remove unused, unaliased
     local variables during highly optimizing compilations.  */
  ann = var_ann (var);
  if (ann
      && ! ann->may_aliases
      && ! ann->used
      && ! ann->has_hidden_use
      && ! TREE_ADDRESSABLE (var)

we already have (!ann).  Something like this should work:

+ if (!ann)
+   return false;
! else if (! ann->may_aliases
(etc.)

I'll make a patch and try if that works.

-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]