This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/9059] unused arrays not optimized away
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2004 10:47:17 -0000
- Subject: [Bug tree-optimization/9059] unused arrays not optimized away
- References: <20021226065600.9059.stefaandr@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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