* libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in
2005 refactor (!) in which the second arg was erroneously taken from
the first arg.
* test-suite/tests/bitvectors.test: Add test.
* doc/ref/api-compound.texi: Fix doc example for u32vector selector.
* module/Makefile.am: Build types.scm early, but don't block the rest of
the build on it.
* module/language/cps/types.scm: Rewrite to use namesets.
* module/language/cps/dce.scm:
* module/language/cps/type-fold.scm: Adapt to interface changes.
* module/language/cps/cse.scm:
* module/language/cps/dfg.scm (compute-idoms, compute-dom-edges): Move
these procedures from cse.scm to dfg.scm.
Remove loop-detection code; that can come back later but it is
bitrotten for now.
Suggested by Eli Zaretskii <eliz@gnu.org>.
* test-suite/test-suite/lib.scm (%null-device): Test for Windows based
by checking for a drive letter in the current directory name.
* test-suite/tests/i18n.test (mingw?): New variable.
(%french-locale-name, %french-utf8-locale-name,
%turkish-utf8-locale-name, %german-utf8-locale-name,
%greek-utf8-locale-name): Add name of corresponding Windows codepage,
when MINGW? is true.
(under-turkish-utf8-locale-or-unresolved): Add exception for
"mingw32".
Co-authored-by: Eli Zaretskii <eliz@gnu.org>
Reported by Eli Zaretskii <eliz@gnu.org>.
* test-suite/test-suite/lib.scm (%null-device): New variable.
* test-suite/tests/c-api.test (egrep): Use %NULL-DEVICE instead of
/dev/null.
* test-suite/tests/popen.test ("open-input-pipe")["no duplicate"]:
Likewise.
* libguile/list.c (scm_ilength): Test for SCM_NULL_OR_NIL_P only after
testing scm_is_pair. Conform to GNU coding standards.
* libguile/srfi-1.c (scm_srfi1_length_plus): Ditto.
Fixes <http://bugs.gnu.org/17147>.
Reported by David Kastrup <dak@gnu.org>.
* module/ice-9/boot-9.scm (and, or): Use dotted tail instead of ellipsis
in patterns.
Fixes <http://bugs.gnu.org/17296>.
* libguile/srfi-1.c (scm_srfi1_length_plus): Rewrite to raise an error
unless passed a proper or circular list, based on code from
'scm_ilength'.
* test-suite/tests/srfi-1.test (length+): Add tests.
Fixes <http://bugs.gnu.org/17661>.
Reported and fixed by Chris Vine <chris@cvine.freeserve.co.uk>.
* libguile/async.h (scm_c_call_with_blocked_asyncs)
(scm_c_call_with_unblocked_asyncs, scm_dynwind_block_asyncs)
(scm_dynwind_unblock_asyncs): Mark as SCM_API.
* THANKS: Add Chris Vine to fixes section.
This yields a 20% improvement on the "read-string" benchmark.
* module/ice-9/rdelim.scm (read-string): Rewrite as a 'case-lambda',
with a tight loop around 'read-char', and without using
'read-string!'.
* test-suite/tests/rdelim.test ("read-string")["longer than 100 chars,
with limit"]: New test.
* benchmark-suite/benchmarks/ports.bm ("rdelim")["read-string"]: New
benchmark.
Fixes <http://bugs.gnu.org/17466>.
Reported by J Kalbhenn <jkal@posteo.eu>.
* libguile/bytevectors.c (scm_c_shrink_bytevector): When BV is
contiguous, add use of 'SCM_BYTEVECTOR_SET_CONTENTS'.
Fixes <http://bugs.gnu.org/15368>.
* module/web/client.scm (open-socket-for-uri): Remove call to
'setsockopt'. Contrary to what the comment said, its effect was to
shrink the receive buffer from 124 KiB (the default size, per
/proc/sys/net/core/rmem_default on Linux-based systems) to 12 KiB.
* module/language/cps/effects-analysis.scm (define-enumeration): New
helper.
(&memory-kind-mask): Define as an enumeration, not a bitfield. Add
&unknown-memory-kinds.
(&all-effects, effect-clobbers?, make-prompt-tag, expression-effects):
Adapt.
Note that this change requires dce.go and cse.go to be recompiled.
* libguile/fports.c (scm_setvbuf): Initialize 'drained'. GCC 4.9 raises
a "may be used uninitialized warning" for 'drained', because it can't
tell that 'drained' is initialized anytime NDRAINED > 0.
* module/language/cps/dce.scm (elide-type-checks!, compute-live-code):
Replace old ad-hoc type check elision with one driven from type
analysis. Type check elision only operates on smallish functions, to
avoid n**2 explosion in type inference.
* module/language/cps/types.scm (infer-types): Add #:max-label-count
argument.
* module/language/cps/type-fold.scm (compute-folded, fold-constants*):
Disable for big functions. Perhaps we can relax this if we find an
O(n log n) way to represent types.
* module/Makefile.am (BOOT_SOURCES, BOOT_GOBJECTS): New variables.
(CLEANFILES, nobase_mod_DATA, nobase_ccache_DATA, EXTRA_DIST)
(ETAGS_ARGS): Use the new variables.
(CPS_LANG_SOURCES): Remove language/cps/types.scm, as it is a boot
file.
* module/language/cps/types.scm: New file, implementing type and range
inference over CPS.
* module/language/cps/type-fold.scm: New file, implementing abstract
constant folding for CPS.
* module/Makefile.am: Add the new files.
* module/language/cps/compile-bytecode.scm: Wire up type-fold, but
currently disabled.
* module/language/cps/effects-analysis.scm: Rewrite so that instead of
the depends/causes effects, there is just &type-check, &allocation,
&read, and &write. The object kind is a separate part of the
bitfield, and the field in the object (if appropriate) is another
field. Effects are still a fixnum. This enables precise effects for
vectors and structs on all architectures.
This kind of effects analysis was not possible in Tree-IL because
Tree-IL relied on logior-ing effects of subexpressions, whereas with
CPS we have no sub-expressions and we do flow analysis instead.
(effect-clobbers?): Replace effects-commute? with this inherently
directional and precise predicate.
* module/language/cps/cse.scm (compute-always-available-expressions):
(compute-equivalent-subexpressions): Adapt to effects analysis
change.
* module/language/cps/dce.scm (compute-live-code): Likewise.
* module/language/cps/cse.scm (compute-always-available-expressions):
Use constant? instead of zero?, to avoid punching through the effects
abstraction.
* module/language/cps/cse.scm (compute-available-expressions):
Simplify initialization.
(compute-equivalent-subexpressions): When synthesizing definitions,
use substed vars. Add synthetic definitions after processing an
expression, to take advantage of the substed vars.
* module/language/cps/effects-analysis.scm (synthesize-definition-effects!):
Fix a boneheaded thinko that caused all primcalls to be marked as
causing car, cdr, vector, struct, and box effects.
* module/system/vm/program.scm (print-program): New public interface --
the guts of write-program, but refactored to be able to work when only
given an addr.
(write-program): Use print-program.
* module/system/vm/frame.scm (frame-call-representation): Remove attempt
to abbreviate procedure representations; was confusing because the
result would write as a string, quotes and all.