From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16235 invoked by alias); 4 Dec 2001 18:00:14 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 16198 invoked from network); 4 Dec 2001 18:00:11 -0000 Received: from unknown (HELO dot.cygnus.com) (205.180.230.224) by sources.redhat.com with SMTP; 4 Dec 2001 18:00:11 -0000 Received: (from rth@localhost) by dot.cygnus.com (8.11.2/8.11.2) id fB4I09c07785; Tue, 4 Dec 2001 10:00:09 -0800 X-Authentication-Warning: dot.cygnus.com: rth set sender to rth@redhat.com using -f Date: Tue, 04 Dec 2001 10:00:00 -0000 From: Richard Henderson To: Peter Barada Cc: gcc@gcc.gnu.org Subject: Re: How are case statements laid out? Message-ID: <20011204100009.F7748@redhat.com> Mail-Followup-To: Richard Henderson , Peter Barada , gcc@gcc.gnu.org References: <200112031751.fB3HpxF15273@hyper.wm.sps.mot.com> <20011203145542.C7284@redhat.com> <200112041511.fB4FBMi25417@hyper.wm.sps.mot.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200112041511.fB4FBMi25417@hyper.wm.sps.mot.com>; from pbarada@mail.wm.sps.mot.com on Tue, Dec 04, 2001 at 10:11:22AM -0500 X-SW-Source: 2001-12/txt/msg00136.txt.bz2 On Tue, Dec 04, 2001 at 10:11:22AM -0500, Peter Barada wrote: > Do you have an example? Well, the easiest example is gcc -O2 -S -fno-reorder-blocks z.c int foo(int i) { if (i < 0) { label: return -1; } switch (i) { case 0: return 0; case 1: return 1; case 2: return 2; case 3: return 3; case 4: return 4; case 5: goto label; } return 6; } as the goto will be folded into the table jump directly. But apart from that -freorder-blocks will rearrange everything as it sees fit. r~