summaryrefslogtreecommitdiff
path: root/src/chartab.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2002-03-05 00:08:31 +0000
committerKenichi Handa <handa@m17n.org>2002-03-05 00:08:31 +0000
commit22d49f94bde4da2f582a3ad77e2f70fb4d6370da (patch)
treef5888de58124437025c55ae0901ae8ad40acc7f3 /src/chartab.c
parent885317d81756eb4769953d9980481cea029a9a06 (diff)
downloademacs-22d49f94bde4da2f582a3ad77e2f70fb4d6370da.tar.gz
(sub_char_table_set_range): Optimized for the case
DEPTH == 3. Add workaround code for a GCC optimization bug.
Diffstat (limited to 'src/chartab.c')
-rw-r--r--src/chartab.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/chartab.c b/src/chartab.c
index 5bf6d6e3550..8e942beaae8 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -377,7 +377,7 @@ sub_char_table_set_range (table, depth, min_char, from, to, val)
{
int max_char = min_char + chartab_chars[depth] - 1;
- if (from <= min_char && to >= max_char)
+ if (depth == 3 || from <= min_char && to >= max_char)
*table = val;
else
{
@@ -390,12 +390,12 @@ sub_char_table_set_range (table, depth, min_char, from, to, val)
from = min_char;
if (to > max_char)
to = max_char;
+ i = CHARTAB_IDX (from, depth, min_char);
j = CHARTAB_IDX (to, depth, min_char);
- for (i = CHARTAB_IDX (from, depth, min_char); i <= j; i++)
+ min_char += chartab_chars[depth] * i;
+ for (; i <= j; i++, min_char += chartab_chars[depth])
sub_char_table_set_range (XSUB_CHAR_TABLE (*table)->contents + i,
- depth,
- min_char + chartab_chars[depth] * i,
- from, to, val);
+ depth, min_char, from, to, val);
}
}