[Bug tree-optimization/17046] An unused array is not optimized away.

kazu at cs dot umass dot edu gcc-bugzilla@gcc.gnu.org
Mon Aug 16 07:31:00 GMT 2004


------- 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



More information about the Gcc-bugs mailing list