sbcl.git
11 years agofix a bug in signed modular arithmetic
Christophe Rhodes [Tue, 4 Dec 2012 20:50:12 +0000 (20:50 +0000)]
fix a bug in signed modular arithmetic

Sadly not the ones that Eric gently reminds us of every month or so, but
a far more basic one.  If something is a (signed-byte x), its integer-length
will be at most (1- x).  Search appropriately for a signed arithmetic
variant.

11 years agofix direct execution of (shebanged) fasls
Christophe Rhodes [Tue, 4 Dec 2012 20:19:23 +0000 (20:19 +0000)]
fix direct execution of (shebanged) fasls

Broken since 4993cd5, when fasl-header-p stopped working on bivalent
streams.  Make it work on bivalent streams, as long as they're
seekable (i.e. don't sniff stdin for a fasl header; bad things happen).

11 years agoSuppress warnings about possible slot name conflicts with slots from SB-PCL.
Stas Boukarev [Sat, 1 Dec 2012 19:44:37 +0000 (23:44 +0400)]
Suppress warnings about possible slot name conflicts with slots from SB-PCL.

When inheriting from STANDARD-CLASS and using common slot names, like
SLOTS or NAME, SBCL signals a style-warning about possible package
problems with slots with the same name from SB-PCL, which is unlikely
to ever cause a problem.

11 years agoupdate release.sh to my version of reality
Christophe Rhodes [Sat, 1 Dec 2012 14:32:25 +0000 (14:32 +0000)]
update release.sh to my version of reality

Mostly removing features and writing FIXMEs about what isn't yet
working for me.

11 years ago1.1.2: will be tagged as "sbcl-1.1.2"
Christophe Rhodes [Sat, 1 Dec 2012 11:32:29 +0000 (11:32 +0000)]
1.1.2: will be tagged as "sbcl-1.1.2"

11 years agoLLP64: replace use of unsigned long with size_t in parse_size_arg
David Lichteblau [Mon, 12 Nov 2012 16:33:47 +0000 (17:33 +0100)]
LLP64: replace use of unsigned long with size_t in parse_size_arg

Thanks to Anton Kovalenko.

11 years agoAdd mswin.def
David Lichteblau [Fri, 23 Nov 2012 14:05:52 +0000 (15:05 +0100)]
Add mswin.def

Fixes the build on Windows.

11 years agoNEWS tweaks
David Lichteblau [Mon, 19 Nov 2012 19:25:57 +0000 (20:25 +0100)]
NEWS tweaks

11 years agoLLP64: change signed long to sword_t
David Lichteblau [Mon, 12 Nov 2012 17:19:47 +0000 (18:19 +0100)]
LLP64: change signed long to sword_t

Adjust uses of `long' in the C runtime for LLP64 platforms:
Replace `long' with `sword_t' where applicable.

Thanks to Anton Kovalenko.

11 years agoLLP64: change UNSIGNED-LONG to UNSIGNED
David Lichteblau [Fri, 9 Nov 2012 13:25:42 +0000 (14:25 +0100)]
LLP64: change UNSIGNED-LONG to UNSIGNED

Adjust references to alien types within Lisp code for LLP64 platforms,
replacing UNSIGNED-LONG with UNSIGNED.

UNSIGNED-LONG is currently used when pointer-size values are desirable,
but does not have that meaning on LLP64 platforms.

Note: UNSIGNED does not in general refer to C's `unsigned'; rather it
means (UNSIGNED N-WORD-BITS).  UNSIGNED-LONG actually means `unsigned
long'.  The implication is that

  32 <= sizeof(UNSIGNED-LONG) <= sizeof(UNSIGNED) <= 64

and not, as one might have expected, the other way around.  Existing
platforms were assuming these two types to be the same.

Thanks to Anton Kovalenko.

11 years agoLLP64: change unsigned long to uword_t
David Lichteblau [Mon, 12 Nov 2012 15:35:23 +0000 (16:35 +0100)]
LLP64: change unsigned long to uword_t

Adjust uses of `unsigned long' in the C runtime for LLP64 platforms:
Replace with `uword_t' where applicable.

Thanks to Anton Kovalenko.

11 years agoLLP64: replace uses of sizeof(long) where pointer size is meant
David Lichteblau [Mon, 12 Nov 2012 15:11:28 +0000 (16:11 +0100)]
LLP64: replace uses of sizeof(long) where pointer size is meant

Thanks to Anton Kovalenko.

11 years agoLLP64: adjust calls to printf-like functions with pointer arguments
David Lichteblau [Mon, 12 Nov 2012 15:19:58 +0000 (16:19 +0100)]
LLP64: adjust calls to printf-like functions with pointer arguments

For the benefit of LLP64 platforms, do not cast to long when printing a
pointer, and use %p instead of %lx.  If casting is required, cast to
a pointer-sized unsigned integer, not signed long.

Thanks to Anton Kovalenko.

11 years agoLLP64: change long to uword_t (thereby flipping signedness)
David Lichteblau [Mon, 12 Nov 2012 16:01:08 +0000 (17:01 +0100)]
LLP64: change long to uword_t (thereby flipping signedness)

Replace `long' with `uword_t' in the runtime where applicable.

In these cases, signed long could have been translated literally as
sword_t to support LLP64 platforms, but uword_t seems clearer.

Thanks to Anton Kovalenko.

11 years agoNew types uword_t, sword_t
David Lichteblau [Thu, 8 Nov 2012 16:04:03 +0000 (17:04 +0100)]
New types uword_t, sword_t

First commit in a series of changes for LLP64 platform support.

We have been using `(un)signed long' assuming that it is an integer
of the same size as a pointer.  On Windows x64 this assumption does
not hold, and `(un)signed long long' is required for the same
purpose.

Code will be updated to use our own types uword_t, sword_t instead,
which are defined to be synonyms of uintptr_t and intptr_t, respectively.

Note that uword_t is also synonymous with our older type
pointer_sized_uint_t, and technically (albeit not conceptually) the
same as lispobj.

Thanks to Anton Kovalenko.

11 years agoAdd a lock to io_end_interruptible, win32_maybe_interrupt_io
David Lichteblau [Mon, 19 Nov 2012 16:54:58 +0000 (17:54 +0100)]
Add a lock to io_end_interruptible, win32_maybe_interrupt_io

Fixes hangs in test :INTERRUPT-IO-UNNAMED-PIPE.

11 years agoUnbreak ppc builds with 4k *backend-page-bytes*
Joshua Elsasser [Sun, 18 Nov 2012 22:38:16 +0000 (14:38 -0800)]
Unbreak ppc builds with 4k *backend-page-bytes*

11 years agoOnly try frlock.1 test on #+sb-thread
Joshua Elsasser [Sun, 18 Nov 2012 21:27:17 +0000 (13:27 -0800)]
Only try frlock.1 test on #+sb-thread

11 years ago Update ASDF to 2.26.
Stas Boukarev [Wed, 14 Nov 2012 14:22:50 +0000 (18:22 +0400)]
 Update ASDF to 2.26.

11 years agoForcibly fail frlock.1 on Windows by means of a timeout
David Lichteblau [Tue, 13 Nov 2012 17:13:08 +0000 (18:13 +0100)]
Forcibly fail frlock.1 on Windows by means of a timeout

Presumably due to windows sb-thread bugs, this test often hangs on
Windows.  For now, establish a timeout, and mark the test as a known
failure on this platform.

11 years agoFurther work towards use of win32 file HANDLEs
David Lichteblau [Mon, 5 Nov 2012 13:36:31 +0000 (14:36 +0100)]
Further work towards use of win32 file HANDLEs

Expose the fact that we are working with file handles (not simulated
file descriptors), and directly store those handles in fd-streams.

Represent them as integers (not SAPs) to avoid needless
incompatibilities between POSIX and Windows builds.  However, adjust
types so as to remove fixnum assumptions.

Includes some further tweaks to file-related foreign definitions
(and run-program in particular), to remove remaining uses of CRT
when possible.

Does not add any `feature' to help user code distinguish between
this SBCL and versions prior to this change using read-time
conditionals, since the changes are, in principle, not considered
user-visible.  (We are now unconditionally running the equivalent of
what is marked #!+fds-are-windows-handles on the Windows branch.)

To avoid breaking any user code that might have learned to retrieve
handles from our streams previously, preserve "osf handle"
conversion functions as trivial identity definitions for a while.

Thanks to Anton Kovalenko.

11 years agoPowerPC safepoints
David Lichteblau [Mon, 1 Oct 2012 18:10:44 +0000 (20:10 +0200)]
PowerPC safepoints

"I saw it almost pass tests once.  Ship it."

Rough PowerPC port of sb-safepoint and related features.  Occasional
issues remain (see comment in test suite).

  - Sprinkle fake_foreign_function_call fairy dust over safepoint code.

  - Use the CSP page for synchronization, but not for its value.

  - No altstack, hence no tricks to escape from it.

  - Remove workarounds related to the SIGALRM handler; but keep
    SIGINT happy for now, with a somewhat less questionable check.

11 years agomips: Revert remaining badness from 0.9.1.45.
Alastair Bridgewater [Sat, 9 Jun 2012 15:50:49 +0000 (11:50 -0400)]
mips: Revert remaining badness from 0.9.1.45.

  * There were two pieces of badness in 0.9.1.45, both to do with
the call_into_lisp LRA handling, and each compensated for the other
to a limited extent.  One change (since reverted) was to decrease
the alignment requirement on positioning the LRA header, allowing
it to be placed on a non-doubleword boundary.  The second change
(being reverted here) was to change the LRA address calculation to
subtract the entry point offset from the address of the header
instead of adding OTHER_POINTER_LOWTAG.  If the header wound up on
a doubleword boundary (the correct alignment) then the LRA computed
would have LIST_POINTER_LOWTAG, leading to badness when doing a
backtrace.  In any event, typechecking the resulting LRA would
fail, and actually attempting to return to it would also fail.

  * Revert to computing the LRA by adding OTHER_POINTER_LOWTAG to
the address of the header, bringing MIPS inline with all of the
other RETURN-PC-HEADER (LRA) using backends.

11 years agoruntime/thread.h: Fix non-thread binding and control stack pointer access.
Alastair Bridgewater [Thu, 8 Nov 2012 23:32:36 +0000 (18:32 -0500)]
runtime/thread.h: Fix non-thread binding and control stack pointer access.

  * In the non-threaded case, these macros used to break up into two
groups, one for x86oids and one for everything else.  This is wrong
just as soon as a non-x86oid port uses a static symbol for the binding
stack pointer.

  * Reorganize the non-threaded cases to parallel the structure of the
threaded case, dispatching on the presense of the static symbol for
binding stack access and specifically detecting non-x86oids for the
control frame pointer access.

11 years agoruntime/cheneygc.c: Use binding-stack-pointer access macro.
Alastair Bridgewater [Thu, 8 Nov 2012 23:32:29 +0000 (18:32 -0500)]
runtime/cheneygc.c: Use binding-stack-pointer access macro.

  * Rather than access current_binding_stack_pointer (a global
variable) directly, use access_binding_stack_pointer() (a macro
defined in thread.h).

11 years agoThou shalt not MAKE-OTHER-IMMEDIATE-TYPE.
Alastair Bridgewater [Tue, 23 Oct 2012 17:47:27 +0000 (13:47 -0400)]
Thou shalt not MAKE-OTHER-IMMEDIATE-TYPE.

  * Really, it's only ever used to make unbound-markers, for which
we have MAKE-UNBOUND-MARKER, which produces more optimal code in
the first place, has a shorter invocation, and reveals intention
far better than using MAKE-OTHER-IMMEDIATE-TYPE.

  * Rewrite all uses of MAKE-OTHER-IMMEDIATE-TYPE, excise the VOPs
from all of the backends, and remove the symbol name from package-
data.

  * And add DESCRIPTOR-REG to the permitted SCs for
MAKE-UNBOUND-MARKER, since it now must be legal to use a TN of
primitive-type T.

11 years agocompiler/generic/genesis: Report FDEFN addresses for undefined functions.
Alastair Bridgewater [Sun, 4 Nov 2012 17:43:27 +0000 (12:43 -0500)]
compiler/generic/genesis: Report FDEFN addresses for undefined functions.

  * In order to make debugging bootstrapping problems easier,
include the address of FDEFNs which have not been defined in the
cold-sbcl.map file.  This address is what shows up in ldb when
such an FDEFN is invoked.

11 years agocompiler/sparc/arith: Fix SCs for FAST-EQL{,-C}/FIXNUM.
Alastair Bridgewater [Thu, 8 Nov 2012 23:18:28 +0000 (18:18 -0500)]
compiler/sparc/arith: Fix SCs for FAST-EQL{,-C}/FIXNUM.

  * There's a KLUDGE in build-order.lisp-expr wherein failures
when building this file are ignored.

  * The failures are specifically an SC vs. arg-type mismatch for
the FAST-EQL/FIXNUM and FAST-EQL-C/FIXNUM VOPs.

  * Fix the mismatch by altering the VOP definitions to match what
the MIPS backend uses (since it doesn't have the failure).

  * And remove SPARC from the reader conditional on the KLUDGE.

11 years agoalien type improvement: handle offsets in unparse-alien-record-type
Cyrus Harmon [Mon, 15 Oct 2012 06:12:58 +0000 (23:12 -0700)]
alien type improvement: handle offsets in unparse-alien-record-type

Previously, when recomputing the offset to struct fields we would
ignore the offset and attempt to recompute it, occasionally getting it
wrong. Now store the offset in uparse-alien-record-field and use in
parse-alien-record-fields.

Also, fix some comment typos.

11 years agosb-concurrency: frlocks
Nikodemus Siivola [Mon, 8 Oct 2012 07:09:53 +0000 (10:09 +0300)]
sb-concurrency: frlocks

11 years agoSafepoint protocol upgrade
David Lichteblau [Wed, 31 Oct 2012 17:06:00 +0000 (18:06 +0100)]
Safepoint protocol upgrade

Upgrade to the new stop-the-world protocol from the Windows branch,
dating back to late 2011, an all-in-one readability and correctness
improvement.

Replace per-thread qrl locks with one process-wide lock for all
operations relating to GC state and the threads' CSP area.  Use
condition variables for notifications on GC state changes.

Thanks to Anton Kovalenko.

11 years agoUpdate NEWS; explain Windows system requirements
David Lichteblau [Tue, 30 Oct 2012 13:51:26 +0000 (14:51 +0100)]
Update NEWS; explain Windows system requirements

11 years agoExtend use of the linkage table to static symbols
David Lichteblau [Tue, 23 Oct 2012 19:55:02 +0000 (21:55 +0200)]
Extend use of the linkage table to static symbols

  - Formerly static symbols are static no more:

  - Always use the linkage table, even in cross compilation.  The
    runtime retrieves the resulting list of foreign symbols and installs
    linkage table entries before calling into Lisp for the first time.

  - Simplify/remove various win32 foreign symbol special cases.

  - Almost remove scratch().

Conditional on feature SB-DYNAMIC-CORE; required on Windows and optional
on other platforms supporting the linkage table.

With this feature, changes to src/runtime can be built using make,
without requiring a slam.sh step to update core files.

For LINKAGE-TABLE platforms only.  Currently supported on x86 and
x86-64.  (PowerPC does not yet work.)  In the interest of simplicity,
disable this feature permanently on non-SB-THREAD platforms, because
these would require unpleasant changes to allocation macros.

Thanks to Anton Kovalenko.

11 years agoMove the global safepoint to one page before static space
David Lichteblau [Mon, 29 Oct 2012 12:43:07 +0000 (13:43 +0100)]
Move the global safepoint to one page before static space

New attempt at finding an optimal location for the global safepoint
page.  Hopefully this solution will cover all our use cases for
the foreseeable future.

  - Relative to static space for architectures with small immediates.

  - Also addresses the requirements of sb-dynamic-core, which needs
    the safepoint to have an absolute address on x86(-64).

Hence, a new macro !gencgc-space-setup -- tweaks space parameters to
squeeze in the safepoint page, while also simplifying parms.lisp for
some platforms.

11 years agoWindows console I/O overhaul
David Lichteblau [Mon, 22 Oct 2012 15:04:38 +0000 (17:04 +0200)]
Windows console I/O overhaul

  - Make non-interruptible I/O interruptable by means of a
    background thread.

  - Fixes lp#308923.

  - Use Unicode in stdio streams.

Thanks to Anton Kovalenko.

11 years agoAllow synchronous win32 I/O to be interrupted, too
David Lichteblau [Fri, 5 Oct 2012 20:10:53 +0000 (22:10 +0200)]
Allow synchronous win32 I/O to be interrupted, too

... if and only if running on a version of Windows new enough to
support doing so.  Two scenarios come to mind where synchronous (i.e.
non-overlapped) I/O might matter:

  - There is one kind of HANDLE which is never overlapped: Unnamed
    pipes.  Unlike named pipes, the feature added by this commit is
    our only option of interrupting I/O on the former.

  - User code might pass in a HANDLE through MAKE-FD-STREAM without
    the right flag set.  In principle, non-interruptibily of such a
    HANDLE is a bug in said user code, but it doesn't hurt to deal
    with these correctly as a side benefit.  (The only Windows
    releases which support re-opening of a HANDLE with the right
    flag also have the functions needed by this commit.)

One downside for users might be an element of surprise, in that the
same SBCL binary will exhibit the presence or lack of features,
respectively, when started on recent Windows or old Windows.  However,
the advantages of offering the feature seem to me to outweigh that
disadvantage.

Thanks to Anton Kovalenko.

11 years ago1.1.1: will be tagged as "sbcl-1.1.1"
Christophe Rhodes [Fri, 2 Nov 2012 09:42:04 +0000 (09:42 +0000)]
1.1.1: will be tagged as "sbcl-1.1.1"

11 years agoFix the single-threaded Windows build
David Lichteblau [Fri, 26 Oct 2012 17:35:17 +0000 (19:35 +0200)]
Fix the single-threaded Windows build

For this release, we purport to support Windows without threads as
an option.  Make it so.

11 years agoDo not assert that the integer returned by UNIX-ISATTY is a BIT
David Lichteblau [Thu, 25 Oct 2012 12:49:08 +0000 (14:49 +0200)]
Do not assert that the integer returned by UNIX-ISATTY is a BIT

11 years agoFix build on MinGW (again)
David Lichteblau [Mon, 22 Oct 2012 14:20:15 +0000 (16:20 +0200)]
Fix build on MinGW (again)

Remove -mno-cygwin, re-added by mistake earlier.

11 years ago.gitignore: Add src/runtime/sparc-funcdef.h
nyef [Thu, 11 Oct 2012 19:55:56 +0000 (19:55 +0000)]
.gitignore: Add src/runtime/sparc-funcdef.h

  * Just another auto-generated file for a rarely-maintained
target.

11 years agoDisable an SB-INTROSPECT test on GENCGC SPARC.
nyef [Thu, 11 Oct 2012 18:28:13 +0000 (18:28 +0000)]
Disable an SB-INTROSPECT test on GENCGC SPARC.

  * Test ALLOCATION-INFORMATION.4 is known to be flaky at best on
GENCGC PPC, and has been observed to fail on GENCGC SPARC.  Since
it's been marked :FAILS-ON for GENCGC PPC, mark it as failing for
GENCGC SPARC as well.

11 years agoGENCGC on SPARC/Linux
nyef [Thu, 11 Oct 2012 18:18:59 +0000 (18:18 +0000)]
GENCGC on SPARC/Linux

  * Tweak make-config.sh to automatically select GENCGC, and to
update the fallback message for those poor bsd-using folks.

  * Copied the gencgc memory map from the SunOS version to use for
Linux (the cheneygc maps were identical, we may as well keep the
parallelism).

  * Also tweaked the linker flags to match.  Not because it was
required to build, but because I don't know why they were changed
for SunOS, and in the absence of such knowledge I'd rather keep
things more or less parallel.

11 years agosrc/runtime/sparc-arch.c: Use si_addr in arch_get_bad_addr().
nyef [Thu, 11 Oct 2012 18:13:02 +0000 (18:13 +0000)]
src/runtime/sparc-arch.c: Use si_addr in arch_get_bad_addr().

  * Since the sparc port was first merged, arch_get_bad_addr() has
only worked when the program counter is within read-only or the
current dynamic space.

  * This is fragile simply because of the existance of static
space and PURIFY.  It is WORSE when you add GENCGC to the mix (to
the point where SunOS with GENCGC doesn't even call
arch_get_bad_addr() anymore).

  * The existing implementation looks like it predates the switch
to sigaction(2) style signal handlers.  SBCL uses si_addr on all
other backends save Alpha (long undermaintained) and HPPA (even
longer undermaintained).  Clearly, this approach works on SunOS.
From testing, it works on at least linux-2.6.32.  We might as well
run with it, since we need it for GENCGC anyway, and we can easily
concoct a test case that would cause a failure using CHENEYGC.

  * So, implementation patterned on any of the other backends, but
leaving the old code in place, conditional-compiled out, as a bit
of a historical note / warning to future historians.

11 years agoUpdate NEWS, make-config.sh
David Lichteblau [Tue, 18 Sep 2012 15:11:40 +0000 (17:11 +0200)]
Update NEWS, make-config.sh

11 years agosb-bsd-sockets: Add a test for interruptible I/O
David Lichteblau [Mon, 24 Sep 2012 16:48:34 +0000 (18:48 +0200)]
sb-bsd-sockets: Add a test for interruptible I/O

Test TCP sockets even without :internet-available, albeit only on
threaded builds.  Check that INTERRUPT-THREAD works in a timely
fashion on threads currently blocked in I/O on a socket.

11 years agoWindows: Use overlapped I/O, CreateFile
David Lichteblau [Tue, 18 Sep 2012 15:12:19 +0000 (17:12 +0200)]
Windows: Use overlapped I/O, CreateFile

Overlapped I/O is win32's asynchronous I/O mechanism, which allows
us to start an I/O operation and explicitly wait for it to finish at
a time of our choosing, such that we can simultaneously await other
events instead of blocking unconditionally.

  - Support for overlapped I/O is a per-HANDLE flag specified at
    file opening time, necessitating a switch to win32's CreateFile
    and away from the CRT's _open.

  - Wrap win32 file operations in POSIX-compatible functions, so
    that UNIX-OPEN, UNIX-READ, UNIX-WRITE, UNIX-CLOSE continue to
    work as before.  Under the hood, these now call our Lisp or C
    functions instead of versions from CRT.

  - For now, these functions still return and expect what passes as
    file descriptors in CRT.

  - INTERRUPT-THREAD is now capable of performing the interruption
    in a target thread blocked in socket I/O, indicated using an
    errno of "EINTR".  Minor changes in FD streams to retry the I/O
    operation explicitly in that case.

Does not yet include changes for console I/O, and instead still
falls back to _read and _write in that case.  Also not yet included
is interruptible non-overlapped I/O, e.g. for unnamed pipes.

Thanks to Anton Kovalenko.

11 years agoImprove basic block ordering for some loops.
Lutz Euler [Wed, 17 Oct 2012 19:05:58 +0000 (21:05 +0200)]
Improve basic block ordering for some loops.

Currently the compiler rotates most loops to minimize branching costs,
but for some loops this actually has the opposite effect (i.e., larger
and slower code being generated), namely for those that already have the
termination test at the end.

So, inhibit loop rotation if such a loop is detected. The decision is
based upon whether the loop's back edge starts with a conditional branch
(don't rotate) or an unconditional branch (do rotate). This heuristic is
correct in simple cases but may err, e.g. if a loop has multiple back
edges. As we didn't try before and don't try now to analyse complex
loops to aid the decision whether to rotate or not, or even how far,
hopefully any differences introduced here will cancel on average with
respect to their impact on performance and code size.

(Loops consisting of only one basic block -- which necessarily have the
termination test at the end -- were (obviously) treated correctly
already. But even small loops can easily consist of multiple blocks, for
example if the loop body contains code from inlining a function call.)

11 years agoTypo and other small fixes in the manuals and the man page
Lutz Euler [Sat, 13 Oct 2012 19:11:43 +0000 (21:11 +0200)]
Typo and other small fixes in the manuals and the man page

That is, in the texinfo files of the user manual, the internals manual,
and in sbcl.1. Fix spelling and grammar errors, put sufficiently many
dots in abbreviations and consistently write "SBCL" in all caps in
prose. Also, SIGABORT should be SIGABRT.

11 years agoallow SB-CONTRIB operation without explicitly set CC
Nikodemus Siivola [Mon, 8 Oct 2012 05:49:41 +0000 (08:49 +0300)]
allow SB-CONTRIB operation without explicitly set CC

  Fall back to "cc" with a style-warning.

11 years agodon't close runtime dlhandle on Darwin
Nikodemus Siivola [Sun, 7 Oct 2012 12:20:21 +0000 (15:20 +0300)]
don't close runtime dlhandle on Darwin

  On newish Darwin it works, but some people still run old enough
  version that it won't work. As long as we're not explicitly checking
  for "Darwin new enough?", let's try not to break...

  Fixes lp#957385

11 years agomake it possible to run tests on an installed SBCL
Francois-Rene Rideau [Sat, 14 Apr 2012 16:09:46 +0000 (12:09 -0400)]
make it possible to run tests on an installed SBCL

 Allow override of SBCL location via TEST_SBCL_HOME,
 TEST_SBCL_RUNTIME, and TEST_SBCL_CORE.

 Allow override of temporary file location via TEST_DIRECTORY. (Some
 tests still write to /tmp, though -- so user beware!)

 Small unrelated whitespace / style-warning fixes.

11 years agoteach NODE-CONSERVATIVE-TYPE about union types
Nikodemus Siivola [Sun, 7 Oct 2012 11:12:59 +0000 (14:12 +0300)]
teach NODE-CONSERVATIVE-TYPE about union types

  Conservative type of STRING is STRING -- and this makes it so.

  Fixes lp#1050768 (but also future-proof ARRAY-IN-BOUNDS-P against
  '*) explicitly.

11 years agoKill a build warning about unreachable code in MAKE-SEQUENCE.
Lutz Euler [Sat, 6 Oct 2012 18:36:10 +0000 (20:36 +0200)]
Kill a build warning about unreachable code in MAKE-SEQUENCE.

Drop the T clause in a TYPECASE testing for ATOM, CONS and T as ATOM is
specified to be (NOT CONS) which the compiler well knows.

Break some overly long lines.

11 years agoFix some tests for builds without sb-eval.
Lutz Euler [Sat, 6 Oct 2012 16:56:19 +0000 (18:56 +0200)]
Fix some tests for builds without sb-eval.

Conditionalize on #+SB-EVAL test parts that bind *EVALUATOR-MODE* to
:INTERPRET. The affected tests are:
- compiler.pure.lisp / :multiple-args-to-function
- eval.impure.lisp / (eval :empty-let-is-not-toplevel)

11 years agountangle WITH-IR1-NAMESPACE and WITH-COMPILATION-VALUES
Nikodemus Siivola [Fri, 5 Oct 2012 05:26:47 +0000 (08:26 +0300)]
untangle WITH-IR1-NAMESPACE and WITH-COMPILATION-VALUES

 * Move the first out from the latter, and put parts of the first that
   belong in the latter there. They're sufficiently unrelated that
   it's just confusing. Also clarify why some stuff is in W-C-V and
   not W-IR1-N.

 * Places that need W-IR1-N: %COMPILE, COMPILE-LOAD-TIME-STUFF,
   CONVERT-AND-MAYBE-COMPILE. These are our topmost entry points into
   the convert & compile dance.

   ...and PROCESS-TOPLEVEL-LOCALLY, which needs to process
   declarations. We really should separate environment handling and
   compiler.

 * This also removes the unsightly (REMHASH NAME *FREE-FUNS*) hack
   from couple of places.

 * Move *SOURCE-PATHS* binding to WITH-SOURCE-PATHS (new), also
   sufficiently unrelated to be confusing.

 (This fixes the compiler.test.sh regression I managed to introduce.)

11 years agouse SB-EXT:EXIT in expect.sh instead of QUIT
Nikodemus Siivola [Thu, 4 Oct 2012 21:01:43 +0000 (00:01 +0300)]
use SB-EXT:EXIT in expect.sh instead of QUIT

11 years agofix PARSE-NATIVE-NAMESTRING :JUNK-ALLOWED T
Nikodemus Siivola [Thu, 4 Oct 2012 19:39:35 +0000 (22:39 +0300)]
fix PARSE-NATIVE-NAMESTRING :JUNK-ALLOWED T

 (and word-wrap NEWS)

11 years agofix GC-LOGFILE when none has been set
SANO Masatoshi [Wed, 3 Oct 2012 19:11:17 +0000 (22:11 +0300)]
fix GC-LOGFILE when none has been set

  ...and the return value from (SETF GC-LOGFILE).

11 years agomake walker tests happier
Nikodemus Siivola [Wed, 3 Oct 2012 20:40:01 +0000 (23:40 +0300)]
make walker tests happier

  Our improved handling of specials in the walker broke a few tests,
  investigation of which revealed a few further bogosities -- patch
  over the worst of them, partially in the walker, partially by fixing
  tests which expected bogus results.

  LET* walking is still slightly broken when it comes to specials,
  since it isn't properly recursive the way it has to be. Mark the
  test as expected to fail for now -- fixing it ASAP properly.

  (I must have managed to run tests in the wrong tree once again,
  since I didn't catch this before the last push. Sorry!)

11 years agofix structure stack allocation for high-debug code
Nikodemus Siivola [Thu, 27 Sep 2012 07:18:33 +0000 (10:18 +0300)]
fix structure stack allocation for high-debug code

  * Allow values to flow through casts in good-for-dx analysis.

  * Let-convert main-entry points for already inlined optional
    dispatches.

  * Don't preserve single-use debug vars in system-lambdas, no
    matter what the policy says.

  * Don't add INDEFINITE-EXTENT declarations to hairy entries without
    &REST arguments.

  * SB-C::REST-CONVERSION optimization declaration was pretty
    pointless, take it out.

  * Test our DX stuff in high-debug code as well.

11 years agox86-64: micro-optimize LEA DWORD-REG,EA
Nathan Froyd [Sat, 6 Oct 2012 04:04:25 +0000 (00:04 -0400)]
x86-64: micro-optimize LEA DWORD-REG,EA

If we are loading a DWORD EA into a DWORD register, we may not need the
REX prefix.  Unlikely to occur in current SBCL code, but does come up
when you're writing your own VOPs for 32-bit operations.

11 years agoUpdate tests for threaded windows builds
David Lichteblau [Tue, 18 Sep 2012 15:12:13 +0000 (17:12 +0200)]
Update tests for threaded windows builds

As with previous changes to the test keywords, some tests are marked
as expected failures or skipped, but merely to keep test suite
output clean; these failures are not expected to be permament and
shall be improved upon later.

11 years agoUse futexes on windows
David Lichteblau [Tue, 18 Sep 2012 15:12:11 +0000 (17:12 +0200)]
Use futexes on windows

11 years agoPreliminary work towards threads on win32
David Lichteblau [Tue, 18 Sep 2012 15:12:09 +0000 (17:12 +0200)]
Preliminary work towards threads on win32

  * Implement SB-THREAD

  * Support WITH-TIMEOUT, etc.

Implementation details:

  * Implement pthreads, futex API on top of Win32.
  * Adds support for the timer facility using sb-wtimer.
  * Implement an interruptable `nanosleep' using waitable timers.
  * Threading on Windows uses safepoints to stop the world.
    On this platform, either all or none of :SB-THREAD, :SB-SAFEPOINT,
    :SB-THRUPT, and :SB-WTIMER need to be enabled together.
  * On this platform, INTERRUPT-THREAD will not run interruptions
    in a target thread that is executing foreign code, even though
    the POSIX version of sb-thrupt still allows this (potentially
    unsafe) form of signalling by default.

Does not yet include interruptible I/O, which will be made available
separately.  Slime users are requested to build SBCL without threads
until then.

Note that these changes alone are not yet sufficient to make SBCL on
Windows an ideal backend.  Users looking for a particularly stable
or thread-enabled version of SBCL for Windows are still advised to
use the well-known Windows branch instead.

This is a merge of features developed earlier by Dmitry Kalyanov and
Anton Kovalenko.

11 years agoPort WITH-TLS-EA and other remaining FS prefix uses to Windows.
David Lichteblau [Wed, 13 Jul 2011 16:01:45 +0000 (18:01 +0200)]
Port WITH-TLS-EA and other remaining FS prefix uses to Windows.

- current-thread-offset-sap

- emit-single-step-test

- Allocation routines

- Disable PSEUDO-ATOMIC on threaded Windows entirely instead of
  changing TLS uses of pseudo-atomic-bits.  We would need a
  temporary register for those changes, and Windows threading is all
  safepoint-based, without the need to support asynchronous signals.

Thanks to Dmitry Kalyanov and Anton Kovalenko.

11 years agoDo not trash registers in tests/win32-stack-unwind.c
David Lichteblau [Fri, 5 Oct 2012 17:56:45 +0000 (19:56 +0200)]
Do not trash registers in tests/win32-stack-unwind.c

11 years agoRun sb-bsd-sockets tests on windows
David Lichteblau [Fri, 5 Oct 2012 17:37:28 +0000 (19:37 +0200)]
Run sb-bsd-sockets tests on windows

Previously, we did not attempt tests for this contrib on Windows at
all, presumably because this (otherwise functional) contrib would
have failed some tests and hence would not have been installed.

Instead, mark the remaining failures as expected, so that they get
reported without preventing installation of the contrib.

11 years agoReenable ALLOCATION-INFORMATION.4, mark as known failure
David Lichteblau [Fri, 5 Oct 2012 16:40:38 +0000 (18:40 +0200)]
Reenable ALLOCATION-INFORMATION.4, mark as known failure

It seems unlikely to me that the combination of features currently
identified as problematic is truly accurate.  More plausible seems
that ALLOCATION-INFORMATION is broken and needs a bug fix.  Yet the
warning now given should be clear enough and allow users to report
this issue.

11 years agoAllow use of SB-RT's mechanism for expected test failures in contribs
David Lichteblau [Mon, 24 Sep 2012 16:48:47 +0000 (18:48 +0200)]
Allow use of SB-RT's mechanism for expected test failures in contribs

... In RT, use the list of expected test failures not just for
    debugging output, but return as a primary result only whether
    there are unexpected failures, with additional result values for
    details on expected failures.

... Tweak make-target-contrib.sh so that the `test-passed' file, if
    non-empty, can indicate a `successful' build of the contrib with
    only known failures.

This mechanism is meant to follow in the footsteps of SBCL's main
test suite's mechanism for known failures, and is arguably not in
the original spirit of contribs as user contributions that must
build perfectly or fail to install entirely.  However, for parts of
contrib/ which are very commonly used as a part of SBCL, it is hoped
that this new mechanism will aid work toward bug fixes in those
contribs rather than de-emphasize it.

11 years agoSPARC gencgc
David Lichteblau [Fri, 28 Sep 2012 18:51:21 +0000 (20:51 +0200)]
SPARC gencgc

Based on Raymond Toy's work.

11 years agoPPC, SPARC cross-type build fix
David Lichteblau [Fri, 5 Oct 2012 13:21:44 +0000 (15:21 +0200)]
PPC, SPARC cross-type build fix

Thanks to Christophe Rhodes.

11 years agoupdate NEWS
Nikodemus Siivola [Wed, 3 Oct 2012 06:22:59 +0000 (09:22 +0300)]
update NEWS

11 years agofix walker handling of LET* bindings shadowing symbol macros
Nikodemus Siivola [Sun, 30 Sep 2012 12:33:23 +0000 (15:33 +0300)]
fix walker handling of LET* bindings shadowing symbol macros

  Don't remove variable bindings from lexenv, which would cause
  symbol-macros to be unshadowed.

  Also treat special bindings correctly -- this comes mostly down to
  processing declarations from the body before processing variable
  bindings.

11 years agomore debug output for the once-in-a-blue-moon cache flushing problem
Nikodemus Siivola [Sun, 30 Sep 2012 12:34:03 +0000 (15:34 +0300)]
more debug output for the once-in-a-blue-moon cache flushing problem

  ...was stupidly printing only 1/3rd of the intended amount of
  information. *sigh*

11 years agobind and clear *CONTINUATION-NUMBERS* &co in WITH-COMPILATION-VALUES
Nikodemus Siivola [Tue, 25 Sep 2012 11:16:16 +0000 (14:16 +0300)]
bind and clear *CONTINUATION-NUMBERS* &co in WITH-COMPILATION-VALUES

  This leaves CLEAR-STUFF empty, so delete it. \o/

11 years agobind and clear *LIST-CONFLICTS-TABLE* in LIST-CONFLICTS
Nikodemus Siivola [Tue, 25 Sep 2012 11:01:31 +0000 (14:01 +0300)]
bind and clear *LIST-CONFLICTS-TABLE* in LIST-CONFLICTS

11 years agobind and clear *SEEN-FUNS* and *SEEN-BLOCKS* in CHECK-IR1-CONSISTENCY
Nikodemus Siivola [Tue, 25 Sep 2012 10:52:23 +0000 (13:52 +0300)]
bind and clear *SEEN-FUNS* and *SEEN-BLOCKS* in CHECK-IR1-CONSISTENCY

11 years agomove clearing of *FREE-FUNS* &co to WITH-IR1-NAMESPACE where they're bound
Nikodemus Siivola [Tue, 25 Sep 2012 10:39:25 +0000 (13:39 +0300)]
move clearing of *FREE-FUNS* &co to WITH-IR1-NAMESPACE where they're bound

11 years agoremove world-lock from WITH-COMPILATION-UNIT
Nikodemus Siivola [Tue, 25 Sep 2012 10:30:59 +0000 (13:30 +0300)]
remove world-lock from WITH-COMPILATION-UNIT

   Add it to SUB-COMPILE-FILE and ACTUALLY-COMPILE instead.

11 years agosort *features*ish variable values for repeatability
Christophe Rhodes [Thu, 20 Sep 2012 18:38:46 +0000 (19:38 +0100)]
sort *features*ish variable values for repeatability

11 years agoone more stray GENSYM leading to fasl differences
Christophe Rhodes [Thu, 20 Sep 2012 15:55:40 +0000 (16:55 +0100)]
one more stray GENSYM leading to fasl differences

11 years agoslightly more reproducible builds
Christophe Rhodes [Thu, 20 Sep 2012 15:10:55 +0000 (16:10 +0100)]
slightly more reproducible builds

in vop templates, (:constant <type>) eventually boiled down to a TYPEP
test.  For (:constant fixnum) in the cross-compiler, this is not right,
because the typep test runs on the host.  Use SB!XC:TYPEP instead, which
means making sure that types are available to the cross-compiler (using
DEF!TYPE instead of DEFTYPE).  Tested on x86-64; one issue on ppc fixed
blindly.

11 years agoallow builds with :trace-file flags even with non-sbcl host compilers
Christophe Rhodes [Thu, 20 Sep 2012 15:10:13 +0000 (16:10 +0100)]
allow builds with :trace-file flags even with non-sbcl host compilers

:allow-other-keys t is a marvellous thing

11 years agomostly make the build deterministic
Christophe Rhodes [Tue, 18 Sep 2012 21:01:12 +0000 (22:01 +0100)]
mostly make the build deterministic

From clisp, about 10 files still differ in xc fasls after these changes.
At least one remaining issue is obvious (floats, where our float constants
aren't representable on clisp) but there are other mysteries.

11 years ago1.1.0: will be tagged as "sbcl-1.1.0"
Christophe Rhodes [Mon, 1 Oct 2012 21:51:32 +0000 (21:51 +0000)]
1.1.0: will be tagged as "sbcl-1.1.0"

11 years agoTry to make test :deferrables-unblocked-by-lock more robust
David Lichteblau [Sun, 30 Sep 2012 11:59:28 +0000 (13:59 +0200)]
Try to make test :deferrables-unblocked-by-lock more robust

  - Use a join thread, not a kill thread, so that we do not kill the
    background thread while it is currently performing the actual
    test.

  - Give the thread more time to start up, to make it more likely
    that its GRAB-MUTEX call needs to wait -- otherwise deferrables would
    not be unblocked.

11 years agoDo not use RETURN-FROM in MAKE-THREAD
David Lichteblau [Sun, 30 Sep 2012 10:50:04 +0000 (12:50 +0200)]
Do not use RETURN-FROM in MAKE-THREAD

Fix for lp#1058799, regression in 1.0.56.55-f0da2f6.

11 years agoMention safepoints in NEWS
David Lichteblau [Tue, 18 Sep 2012 15:11:40 +0000 (17:11 +0200)]
Mention safepoints in NEWS

11 years agoFix the cheneygc build
David Lichteblau [Thu, 27 Sep 2012 18:11:32 +0000 (20:11 +0200)]
Fix the cheneygc build

Thanks to Christoph Egger for the report.

11 years agoDisable ALLOCATION-INFORMATION.4 on gencgc for this release
David Lichteblau [Thu, 27 Sep 2012 17:32:47 +0000 (19:32 +0200)]
Disable ALLOCATION-INFORMATION.4 on gencgc for this release

This test currently exposes a bug in the contrib, yet users might prefer
to install the contrib in spite of this issue.  For this reason I am
disabling the test for the moment.

11 years agoreplace DEFINE-MORE-FUN with compiler smarts
Nikodemus Siivola [Sun, 23 Sep 2012 00:47:15 +0000 (03:47 +0300)]
replace DEFINE-MORE-FUN with compiler smarts

  Now that the compiler knows how to implement (NTH I REST-ARG) efficiently,
  we don't need to play tricks with &MORE: the compiler does that for us.

11 years agomore funky &REST smartness
Nikodemus Siivola [Sat, 22 Sep 2012 22:48:06 +0000 (01:48 +0300)]
more funky &REST smartness

  Extend the earlier VALUES-LIST optimization for &REST arguments
  into other operations as well. For starters:

    CAR
    ELT
    ENDP
    FIRST
    IF
    LENGTH
    LIST-LENGTH
    NTH

  All of these can now access the hidden &MORE context when given a &REST
  argument that is not used by other operations, making it possible for the
  compiler to elide the entire rest-list allocation in those cases.

11 years agofix "unable to read" compiler-error reporting during SBCL build
Nikodemus Siivola [Sat, 22 Sep 2012 18:55:50 +0000 (21:55 +0300)]
fix "unable to read" compiler-error reporting during SBCL build

  By moving stream-error-position-info into early-extensions.lisp,
  so it's available early enough.

11 years agoadd DEFINE-MORE-FUN, use it for vararg arithmetic functions
Nikodemus Siivola [Sat, 22 Sep 2012 18:46:16 +0000 (21:46 +0300)]
add DEFINE-MORE-FUN, use it for vararg arithmetic functions

  More efficient than consing a rest-list -- even a stack-allocated one, and
  doesn't add extra DX cleanup frames to backtraces.

  Done this way instead of just using &MORE directly in lambda-lists in order
  to mangle the lambda-list into &REST shape for user-consumption.

11 years agoproclaim *CURRENT-THREAD* as always-bound
Nikodemus Siivola [Tue, 18 Sep 2012 21:37:47 +0000 (00:37 +0300)]
proclaim *CURRENT-THREAD* as always-bound

   Eliminates quite a few "check if it's bound" cases from the system, and
   protects against MAKUNBOUND.

11 years agoFix nonthreaded build.
Joshua Elsasser [Sat, 22 Sep 2012 18:44:28 +0000 (11:44 -0700)]
Fix nonthreaded build.

11 years agoFix build on OpenBSD systems with PIE enabled by default in the C compiler.
Joshua Elsasser [Sat, 22 Sep 2012 18:40:50 +0000 (11:40 -0700)]
Fix build on OpenBSD systems with PIE enabled by default in the C compiler.

11 years agoAdd a safepoint-based mechanism to avoid SIGALRM for the TIMER facility
David Lichteblau [Thu, 13 Sep 2012 16:26:19 +0000 (18:26 +0200)]
Add a safepoint-based mechanism to avoid SIGALRM for the TIMER facility

  - Retrofits the signal-free timer thread for Windows (thanks to
    Anton Kovalenko) to POSIXy platforms.

  - Provide os_* functions in the C runtime which simulate the win32
    API for waitable timers.

Currently supported on Linux (timerfd), FreeBSD (kqueue), and SunOS
(completion ports).  A tentative (untested) implementation is
provided for Darwin's kqueue.

11 years agoNew predicate THREAD-EPHEMERAL-P for certain system threads
David Lichteblau [Tue, 18 Sep 2012 17:33:10 +0000 (19:33 +0200)]
New predicate THREAD-EPHEMERAL-P for certain system threads

Adds an `ephemeral' flag to the thread structure and exports it.
When true, we can assume that the thread will be started and stopped
by the runtime automatically as needed.

The flag is currently of a purely informational nature; it does not
change the behaviour of thread-related functions.

Thanks to Anton Kovalenko.