From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30704 invoked by alias); 4 Aug 2003 04:00:33 -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 30693 invoked by uid 48); 4 Aug 2003 04:00:33 -0000 Date: Mon, 04 Aug 2003 04:00:00 -0000 Message-ID: <20030804040033.30692.qmail@sources.redhat.com> From: "pinskia at physics dot uc dot edu" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20030214164600.9707.gertom@rgai.hu> References: <20030214164600.9707.gertom@rgai.hu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug optimization/9707] Unnecessary range test in switches with less than 4 cases X-Bugzilla-Reason: CC X-SW-Source: 2003-08/txt/msg00321.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9707 ------- Additional Comments From pinskia at physics dot uc dot edu 2003-08-04 04:00 ------- Here is a better version of this (f should produce the same code as g) int f (int r) { switch (r) { case 1: return 11; case 2: return 12; case 3: return 13; default: return 20; } } int g(int r) { if(r==1) return 11; else if (r==2) return 12; else if (r==3) return 13; else return 30; }