summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-04-14 10:18:32 +0000
committerBruno Haible <bruno@clisp.org>2003-04-14 10:18:32 +0000
commit5e30c2698e2f96abb2ccf69e24f086bc9bd71883 (patch)
tree80d5121c339f20ee62d2fbe2d8944163c56a2474
parent6bbdde4f5f769875e153315b06a303e92fa008f0 (diff)
downloadgperf-5e30c2698e2f96abb2ccf69e24f086bc9bd71883.tar.gz
Omit the multicompare code output if it is not needed.
-rw-r--r--ChangeLog4
-rw-r--r--src/output.cc4
-rw-r--r--tests/chill.exp12
3 files changed, 6 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 93df3b8..58f48de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2003-01-01 Bruno Haible <bruno@clisp.org>
+ * src/output.cc (Output::output_lookup_function_body): Omit the
+ multicompare code section and its variables when it is not used.
+ * tests/chill.exp: Regenerated.
+
* src/output.c (Output_Compare::output_firstchar_comparison): New
method.
(Output_Compare_Strcmp::output_comparison,
diff --git a/src/output.cc b/src/output.cc
index 23363f4..40bfb44 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -1334,7 +1334,7 @@ Output::output_lookup_function_body (const Output_Compare& comparison) const
printf (" if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)\n"
" {\n");
- if (option[DUP])
+ if (option[DUP] && _total_duplicates > 0)
{
if (option[LENTABLE])
printf (" register %s%s *lengthptr;\n",
@@ -1358,7 +1358,7 @@ Output::output_lookup_function_body (const Output_Compare& comparison) const
output_switches (_head, num_switches, switch_size, _min_hash_value, _max_hash_value, 10);
- if (option[DUP])
+ if (option[DUP] && _total_duplicates > 0)
{
int indent = 8;
printf ("%*s return 0;\n"
diff --git a/tests/chill.exp b/tests/chill.exp
index 4d90f67..18f373a 100644
--- a/tests/chill.exp
+++ b/tests/chill.exp
@@ -446,8 +446,6 @@ in_word_set (str, len)
if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
{
- register struct resword *wordptr;
- register struct resword *wordendptr;
register struct resword *resword;
switch (key - 4)
@@ -1354,16 +1352,6 @@ in_word_set (str, len)
goto compare;
}
return 0;
- multicompare:
- while (wordptr < wordendptr)
- {
- register const char *s = wordptr->name;
-
- if (*str == *s && !strcmp (str + 1, s + 1))
- return wordptr;
- wordptr++;
- }
- return 0;
compare:
{
register const char *s = resword->name;