From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32290 invoked by alias); 16 Aug 2004 07:31:56 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 32282 invoked by uid 48); 16 Aug 2004 07:31:56 -0000 Date: Mon, 16 Aug 2004 07:31:00 -0000 Message-ID: <20040816073156.32281.qmail@sourceware.org> From: "kazu at cs dot umass dot edu" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040816065645.17046.kazu@cs.umass.edu> References: <20040816065645.17046.kazu@cs.umass.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/17046] An unused array is not optimized away. X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg01509.txt.bz2 List-Id: ------- 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