This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/17046] An unused array is not optimized away.
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Aug 2004 07:31:56 -0000
- Subject: [Bug tree-optimization/17046] An unused array is not optimized away.
- References: <20040816065645.17046.kazu@cs.umass.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From kazu at cs dot umass dot edu 2004-08-16 07:31 -------
Yes. In fact, the following piece of code does *not*
generate the array in the assembly output.
static const int banana[] = { 0, 1, 2, 3 };
int
foo (void)
{
return banana[2] * 0;
}
Note that the fix for this bug is important so that we can cleanly
fix PR 14841 because uses of "static const arrays" may disappear
during tree optimization.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17046