2003-11-22 Ulrich Drepper <drepper@redhat.com>
* posix/PTESTS: Fix first test of GA143.
* posix/regex_internal.c (re_dfa_add_node): Add BE, reallocation
isn't likely.
2003-11-21 Ulrich Drepper <drepper@redhat.com>
* posix/regcomp.c (fetch_token): Change interface to match
peek_token. This avoid some copying and reduces code size.
* sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
store mutex address if the current value is ~0l.
* sysdeps/pthread/pthread_cond_timedwait.c
(__pthread_cond_timedwait): Likewise.
* sysdeps/pthread/pthread_cond_broadcast.c
(__pthread_cond_broadcast): Don't use requeue for pshared
condvars.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
(__pthread_cond_wait): Don't store mutex address if the current
value is ~0l.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
(__pthread_cond_timedwait): Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
(__pthread_cond_broadcast): Don't use requeue for pshared
condvars.
* pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
element with ~0l for pshared condvars, with NULL otherwise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
(__pthread_cond_wait): Don't store mutex address if the current
value is ~0l.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
(__pthread_cond_timedwait): Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
(__pthread_cond_broadcast): Don't use requeue for pshared
condvars.
2003-11-21 Jakub Jelinek <jakub@redhat.com>
* posix/tst-rxspencer.c (mb_tests): Don't run identical multi-byte
tests multiple times unnecessarily.
2003-11-21 Jakub Jelinek <jakub@redhat.com>
* posix/bug-regex19.c (BRE, ERE): Define.
(tests): Add many new tests, remove UTF-8 ones.
(do_one_test, do_mb_tests): New functions.
(main): Rewritten using do_one_test and do_mb_tests.
2003-11-20 Ulrich Drepper <drepper@redhat.com>
* posix/PTESTS: Fix first test in GA143.
2003-11-20 Jakub Jelinek <jakub@redhat.com>
* posix/regex_internal.h (re_dfastate_t): Remove trtable_search.
Add word_trtable.
* posix/regex_internal.c (create_newstate_common, free_state):
Don't free trtable_search.
* posix/regexec.c (check_matching): Remove fl_search argument.
(transit_state_sb): Likewise. #ifdef out as unused.
(build_trtable): Remove fl_search argument. Set state->word_trtable
and state->trtable. Build separate word and non-word tables if
multi-byte and they differ for some character.
(transit_state): Remove fl_search argument. Don't update
state->trtable here. Handle state->word_trtable.
#ifdef out unused call to transit_state_sb.
(re_search_internal): Update check_matching caller.
(group_nodes_into_DFAstates): Don't clear non-ascii chars in accepts
bitmask for multi-byte locales.
* posix/bug-regex19.c (tests): Enable some commented out tests, add
2 new tests.
* posix/tst-rxspencer.c (mb_tests): Don't test [[=b=]] for now as
multi-byte. Don't run identical multi-byte tests multiple times
unnecessarily.
(main): Check setlocale return value.
* posix/Makefile (tst-rxspencer-ARGS): Add --utf8 argument.
(tst-rxspencer-ENV): Remove MALLOC_TRACE, add LOCPATH.
($(objpfx)tst-rxspencer-mem): Run another tst-rxspencer test
here, without --utf8 argument but with MALLOC_TRACE.
2003-11-19 Jakub Jelinek <jakub@redhat.com>
* posix/regexec.c (extend_buffers): Don't allocate
twice as big state_log as needed. Don't modify pstr->valid_len
for mb_cur_max == 1 !icase !trans.
* posix/regcomp.c (free_bin_tree): Removed.
(create_tree): Add dfa argument. Don't call re_malloc for
each tree, instead allocate from str_tree_storage.
(re_dfa_add_tree_node): New function.
(free_dfa_content): Handle freeing if dfa->nodes == NULL
or dfa->state_table == NULL.
(re_compile_internal): Call free_dfa_content if init_dfa
fails. Call free_workarea_compile, re_string_destruct
and free_dfa_content for most of the other failure paths.
(init_dfa): Initialize str_tree_storage_idx.
Don't clear any fields on allocation failure.
(free_workarea_compile): Free str_tree_storage chunks
instead of free_bin_tree (dfa->str_tree).
(parse): Call re_dfa_add_tree_node instead of re_dfa_add_node
followed by create_tree. Add dfa argument to remaining
create_tree calls. Remove new_idx variable. Remove calls
to free_bin_tree.
(parse_reg_exp, parse_branch, parse_expression, parse_sub_exp,
parse_dup_op, parse_bracket_exp, build_charclass_op): Likewise.
(duplicate_tree): Remove calls to free_bin_tree, add dfa
argument to create_tree.
* posix/regex_internal.h (BIN_TREE_STORAGE_SIZE): Define.
(bin_tree_storage_t): New type.
(re_dfa_t): Add str_tree_storage and str_tree_storage_idx
fields.
* posix/Makefile (tests): Add bug-regex21.
(generated): Add bug-regex21-mem, bug-regex21.mtrace,
tst-rxspencer-mem and tst-rxspencer.mtrace.
(tests): Depend on $(objpfx)bug-regex21-mem
and $(objpfx)tst-rxspencer-mem.
(bug-regex21-ENV, tst-rxspencer-ENV): Set.
($(objpfx)bug-regex21-mem, $(objpfx)tst-rxspencer-mem): New.
* posix/tst-rxspencer.c (main): Add call to mtrace.
Free line at the end.
* posix/bug-regex21.c: New test.
* posix/regexec.c (get_subexp): After calling get_subexp_sub
2003-11-14 David Mosberger <davidm@hpl.hp.com>
* sysdeps/unix/sysv/linux/ia64/sysdep.h
(GAS_ALIGN_BREAKS_UNWIND_INFO): Define this macro to indicate
that all existing GAS versions have a problem with .align inside
a function.
* sysdeps/ia64/memccpy.S: Work around GAS_ALIGN_BREAKS_UNWIND_INFO bug.
* sysdeps/ia64/memcpy.S: Likewise.
* sysdeps/ia64/memset.S: Likewise.
* sysdeps/ia64/memmove.S: Likewise. Also move the jump-table to
out of .text into .rodata, where it belongs.
* sysdeps/unix/sysv/linux/ia64/pipe.S: There is no need to
save/restore input-arguments, because they're necessarily
preserved by the kernel to support syscall-restart.
* posix/regex_internal.h (re_token_type_t): Remove unused ALT,
END_OF_RE_TOKEN_T and SUBEXP. Reorder values. Add OP_UTF8_PERIOD
and EPSILON_BIT.
(IS_EPSILON_NODE): Just test if EPSILON_BIT is set.
(ACCEPT_MB_NODE): Return 1 for OP_UTF8_PERIOD as well.
* posix/regex_internal.c (create_ci_newstate, create_cd_newstate):
Handle OP_UTF8_PERIOD.
(re_string_reconstruct): Set valid_len for single byte char searching
with no translation and case sensitivity.
* posix/regcomp.c (re_compile_fastmap_iter, calc_first): Handle
OP_UTF8_PERIOD.
(re_compile_internal): Don't call optimize_utf8 if preg->translate
!= NULL.
(optimize_utf8): Remove BACK_SLASH case.
Transform OP_PERIOD into OP_UTF8_PERIOD if the searching can be
optimized.
(parse_bracket_exp): Don't create SIMPLE_BRACKET if it doesn't have
any bits set and COMPLEX_BRACKET is used.
* posix/regexec.c (transit_state_mb): Fix comment typo.
(group_nodes_into_DFAstates, check_node_accept): Handle
OP_UTF8_PERIOD.
(check_node_accept_bytes): Likewise. Reorder slightly so that
re_string_char_size_at and re_string_elem_size_at are called
only when needed.
* posix/bug-regex20.c (BRE, ERE): Define.
(tests): Use them to make lines shorter. Expect . to be
optimized. Add lots of new tests.
(main): Run (ATM just case sensitive) test with backwards searching
as well.
2003-11-18 Jakub Jelinek <jakub@redhat.com>
2003-11-17 Jakub Jelinek <jakub@redhat.com>
* posix/regcomp.c (optimize_utf8): Optimize multi-byte chars as
well.
* posix/bug-regex20.c (tests): Add new tests. Multi-byte char
followed by dup operator is expected to be optimized.
* posix/regexec.c (check_node_accept_bytes): Move nrules and j
variables to the block where they are only used, initialize
nrules only immediately before using it.
2003-11-15 Andreas Jaeger <aj@suse.de>
* sysdeps/x86_64/fpu/s_scalbnl.S: New file.
* sysdeps/x86_64/fpu/s_truncl.S: New file.
* sysdeps/x86_64/fpu/s_nearbyintl.S: New file.
* sysdeps/x86_64/fpu/s_floorl.S: New file.
* sysdeps/x86_64/fpu/s_ilogbl.S: New file.
* sysdeps/x86_64/fpu/e_remainderl.S: New file.
* math/libm-test.inc (floor_test): Test also 0.25.
(ceil_test): Test -0.25.
* posix/regex_internal.h: Add forward declaration of re_dfa_t.
Replace last two parameters of re_string_allocate and
re_string_construct with pointer to DFA.
(re_dfa_t): Add map_notascii field.
* posix/regcomp.c (re_compile_internal): Add call of
re_string_construct.
(init_dfa): Initialize mpa_notascii.
* posix/regex_internal.c: Adjust definitions of re_string_allocate
and re_string_construct.
Pass DFA to re_string_construct. Adjust definition. Initialize
map_notascii field.
(build_wcs_upper_buffer): If map_notascii is zero use simplfied
method to map ASCII values to upper case.
* posix/regex.c: Include localeinfo.h.
* posix/regexec.c: Adjust call of re_string_allocate.
* locale/langinfo.h: Add _NL_CTYPE_MAP_TO_NONASCII.
* locale/localeinfo.h (LIMAGIC): Change value.
* locale/categories.def. Add entry for _NL_CTYPE_MAP_TO_NONASCII.
* locale/C-ctype.h: Likewise.
* locale/programs/ld-ctype.c: Compute whether any mapping maps from
ASCII to non-ASCII value. Write out that value.
2003-11-15 Ulrich Drepper <drepper@redhat.com>
* wcsmbs/mbsinit.c: Undef mbsinit and __mbsinit.
* include/wchar.h: Provide inline versions of mbsinit and __mbsinit.
2003-11-14 Jakub Jelinek <jakub@redhat.com>
* posix/tst-rxspencer.c (check_match): @ without any following
characters must match only end of string.
(main): Fix filename in error message.
2003-11-04 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/ifaddrs.c: Make sure it's the kernel who
sends the netlink data.
* sysdeps/unix/sysv/linux/check_pf.c: Likewise.
2003-11-13 Jakub Jelinek <jakub@redhat.com>
* posix/regcomp.c (optimize_utf8): Optimize even if SIMPLE_BRACKET
with no bits set for >= 0x80 chars is seen.
* posix/bug-regex20.c (tests): Add new tests. Expect [ABC] to be
optimized.
(main): Run all tests with RE_ICASE as well.
* posix/Makefile: Add rules to build and run tst-rxspencer.
(distribute): Add rxspencer/tests and rxspencer/COPYRIGHT.
* posix/tst-rxspencer.c: New file.
* posix/rxspencer/tests: New file.
* posix/rxspencer/COPYRIGHT: New file.
Patch mostly by Jakub Jelinek.
* posix/regcomp.c (parse_bracket_exp): Don't check for range if
this is no option given the first token.
* posix/regcomp.c (parse_bracket_exp): Fix test for EOS after
hyphen in range expression. Return EBRACK in this case.
* posix/regcomp.c (parse_bracket_element): Reject hyphens unless
we expect them or it's the last element in the bracket expression.
Indicated by new parameter. Adjust all callers.
Prettier error messages.
* posix/regcomp.c (parse_expression): If token is OP_OPEN_DUP_NUM
and RE_CONTEXT_INVALID_DUP syntax flag is set, fail.
* posix/regex.h (RE_CONTEXT_INVALUD_OPS): New macro.
(RE_SYNTAX_POSIX_BASIC): Use RE_CONTEXT_INVALUD_OPS.
* posix/regcomp.c (parse_sub_exp): In case of not-matching ( )
return REG_EPAREN.
* posix/regcomp.c (optimize_utf8): New function.
(re_compile_fastmap_iter): Use dfa->mb_cur_max > 1 instead
of !icase.
(re_compile_internal): Call optimize_utf8 if not case insensitive
and in UTF-8 locale.
* posix/regex_internal.h: Ifdef out some prototypes if
RE_NO_INTERNAL_PROTOTYPES is defined to shut up warnings.
* posix/Makefile (tests): Add bug-regex20.
(bug-regex20-ENV): Add LOCPATH.
* posix/bug-regex20.c: New test.
2003-11-12 Jakub Jelinek <jakub@redhat.com>
2003-11-12 Jakub Jelinek <jakub@redhat.com>
* io/ftw.c (NFTW_NEW_NAME, NFTW_OLD_NAME): Add prototypes.
2003-11-12 Jakub Jelinek <jakub@redhat.com>
* posix/tst-regex.c (umemlen): New variable.
(test_expr): Add expectedicase argument. Test case insensitive
searches as well as backwards searches (case sensitive and
insensitive) too.
(run_test): Add icase argument. Use it to compute regcomp flags.
(run_test_backwards): New function.
(main): Cast read to size_t to avoid warning. Set umemlen.
Add expectedicase arguments to test_expr.
* posix/regex_internal.c (re_string_reconstruct): If is_utf8,
find previous character by walking back instead of converting
all chars from beginning.
2003-11-12 Jakub Jelinek <jakub@redhat.com>
* posix/regex_internal.h (struct re_string_t): Add is_utf8
and mb_cur_max fields.
(struct re_dfa_t): Likewise. Reorder fields to make structure
smaller on 64-bit arches.
(re_string_allocate, re_string_construct): Add mb_cur_max and
is_utf8 arguments.
(re_string_char_size_at, re_string_wchar_at): Use pstr->mb_cur_max
instead of MB_CUR_MAX.
* posix/regcomp.c (re_compile_fastmap_iter): Use dfa->mb_cur_max
instead of MB_CUR_MAX.
(re_compile_internal): Pass new arguments to re_string_construct.
(init_dfa): Initialize mb_cur_max and is_utf8 fields.
(peek_token, peek_token_bracket): Use input->mb_cur_max instead
of MB_CUR_MAX.
(parse_expression, parse_bracket_exp, parse_charclass_op): Use
dfa->mb_cur_max instead of MB_CUR_MAX.
* posix/regex_internal.c (re_string_construct_common): Add
mb_cur_max and is_utf8 arguments. Initialize fields with them.
(re_string_allocate, re_string_construct): Add mb_cur_max and
is_utf8 arguments, pass them to re_string_construct_common.
Use mb_cur_max instead of MB_CUR_MAX.
(re_string_realloc_buffers): Use pstr->mb_cur_max instead of
MB_CUR_MAX.
(re_string_reconstruct): Likewise.
(re_string_context_at): Use input->mb_cur_max instead of
MB_CUR_MAX.
(create_ci_newstate, create_cd_newstate): Use dfa->mb_cur_max
instead of MB_CUR_MAX.
* posix/regexec.c (re_search_internal): Likewise.
Pass new arguments to re_string_allocate.
(check_matching, transit_state_sb): Use dfa->mb_cur_max instead of
MB_CUR_MAX.
(extend_buffers): Use pstr->mb_cur_max instead of MB_CUR_MAX.
2003-11-12 Jakub Jelinek <jakub@redhat.com>
* posix/Makefile (tests): Add bug-regex19.
(bug-regex19-ENV): Add LOCPATH.
* posix/bug-regex19.c: New test.