This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: c/7344: performance regression on huge case statements
- From: Graham Stott <graham dot stott at btinternet dot com>
- To: jh at suse dot cz, gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 Oct 2002 19:52:24 +0100
- Subject: Re: c/7344: performance regression on huge case statements
Jan,
This patch is broken it doesn't do what you intended because of an
obvious problem in the expr.c part of your patch.
range is a rtx and cfun->max_jumptable_ents is an int.
Graham
Index: expr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/expr.c,v
retrieving revision 1.486
diff -c -3 -p -r1.486 expr.c
*** expr.c 7 Oct 2002 07:37:09 -0000 1.486
--- expr.c 11 Oct 2002 14:49:57 -0000
*************** do_tablejump (index, mode, range, table_
*** 10941,10946 ****
--- 10930,10938 ----
enum machine_mode mode;
{
rtx temp, vector;
+
+ if (range > cfun->max_jumptable_ents)
+ cfun->max_jumptable_ents = range;
/* Do an unsigned comparison (in the proper mode) between the index
expression and the value which represents the length of the range.