Fixes <http://bugs.gnu.org/18299>.
Reported by Frank Terbeck <ft@bewatermyfriend.org>.
* module/language/tree-il/analyze.scm (format-string-argument-count):
Add case for ~p.
* test-suite/tests/tree-il.test ("warnings")["format"]("~p", "~p, too
few arguments", "~:p", "~:@p, too many arguments", "~:@p, too few
arguments"): New tests.
* module/language/cps/types.scm (&all-types): Represent true and false
as separate bits, so that #f can be removed from types on true
branches. Adapt all users.
* module/language/cps/type-fold.scm (&scalar-types):
(fold-and-reduce): Adapt to boolean type representation change.
* module/ice-9/boot-9.scm (add-to-load-path): Remove argument from
%load-path (if it exists) before pushing. This also means that the
`elt' will always be at the front of %load-path.
* module/language/cps/simplify.scm (redominate): Add micropass to
rewrite the scope tree to reflect the dominator tree. Will enable
better eta reduction.
* module/language/cps/slot-allocation.scm (allocate-slots): For
continuations of $call, $callk, and $values with multiple
predecessors, recalculate the set of live slots. Fixes miscompilation
of ice-9/futures.scm:process-future!, broken since the previous patch,
now that $kreceive continuations can have multiple predecessors.
* module/language/cps/renumber.scm (compute-new-labels-and-vars):
(compute-tail-path-lengths, sort-conts): Arrange to visit successors
in such a way that if branches are unsorted, the longest path length
will appear first. This keeps loop bodies together.
Suggested by Dale P. Smith.
* module/system/base/target.scm (cpu-endianness): Add cases for
"arm.*eb", "^aarch64.*be", and "aarch64". Change "arm" case to
"arm.*".
(triplet-pointer-size): Allow underscore as in 'aarch64_be'.
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["armeb-unknown-linux-gnu",
"aarch64-linux-gnu", "aarch64_be-linux-gnu"]: New tests.
Reported by Sylvain Beucler <beuc@beuc.net>.
* module/system/base/target.scm (cpu-endianness): Add case where CPU is
"arm".
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["arm-unknown-linux-androideabi"]:
New test.
* module/language/cps/type-fold.scm (fold-and-reduce): Don't require
types to check out; it could be that the reduced expression can
exhibit the same type-check effects. Reduce for all continuations,
even $kreceive. Pass dfg to reducer.
(mul): Check types.
(logbit?): New reducer.
* libguile/load.c (scm_i_mirror_backslashes): New function.
(scm_init_load_path): Call it to produce MS-Windows file names
with forward slashes.
(FILE_NAME_SEPARATOR_STRING): Define as "/" on all platforms.
* libguile/load.h (scm_i_mirror_backslashes): Add prototype.
* libguile/init.c (scm_boot_guile): Call scm_i_mirror_backslashes
on argv[0].
* libguile/filesys.c (scm_getcwd): Call scm_i_mirror_backslashes
on the directory name returned by getcwd.
* test-suite/tests/ports.test ("file name separators"): New test.
* module/language/cps/effects-analysis.scm: Add entries for logtest and
logbit?.
* module/language/cps/types.scm (logtest, logbit?): New checkers and
inferrers.
* module/language/tree-il/peval.scm (peval): Convert (zero? (logand a
b)) to (logtest a b), in anticipation of opcode support for logtest.
*
module/language/tree-il/primitives.scm (*interesting-primitive-names*):
(*effect-free-primitives*): Add logtest and logbit?.
* module/language/cps/dfg.scm (compute-live-variables): Convert to use
intsets, and fold in compute-maximum-fixed-point.
(print-dfa): Update.
* module/language/cps/slot-allocation.scm (dead-after-def?)
(dead-after-use?, allocate-slots): Convert to use intsets.
This was a failed experiment. It had good space complexity but terrible
time complexity.
* module/Makefile.am: Update.
* module/language/cps/nameset.scm: Remove.
* 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.
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.