From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3852 invoked by alias); 2 Apr 2002 00:56:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3836 invoked by uid 71); 2 Apr 2002 00:56:00 -0000 Date: Mon, 01 Apr 2002 16:56:00 -0000 Message-ID: <20020402005600.3835.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Tom Tromey Subject: Re: java/5941: incorrect "Unreachable statement" error Reply-To: Tom Tromey X-SW-Source: 2002-04/txt/msg00020.txt.bz2 List-Id: The following reply was made to PR java/5941; it has been noted by GNATS. From: Tom Tromey To: Eric Blake Cc: shroff@transeda.com, gcc-gnats@gcc.gnu.org, Per Bothner Subject: Re: java/5941: incorrect "Unreachable statement" error Date: 01 Apr 2002 17:57:19 -0700 >>>>> "Eric" == Eric Blake writes: Eric> for (int i = 0; ; i++) break; Eric> is legal, even though i++ will never be executed, because i++ is Eric> not a complete statement and is therefore not subject to the Eric> rules of JLS 14.20. Thanks for looking into this. Unfortunately it looks difficult to fix the bug due to how loops are represented in gcj. One approach to fixing it would be to introduce a new FOR tree, which we could then handle specially in check-init. Then later we would lower this FOR to a LOOP_EXPR. We'll want to do something like this anyway for the AST work. Tom