Skip to content
Snippets Groups Projects
Commit e9a598e5 authored by Raymond Toy's avatar Raymond Toy
Browse files

Complex array accessors are not foldable

Fixes #61 and #62.

The `ARRAY-HAS-FILL-POINTER-P` and `ARRAY-DISPLACEMENT` functions are
declared inline and the compiler tries to constant-fold these inlined
functions operating on simple arrays.

Thus don't allow the compiler to constant-fold calls to
`%ARRAY-FILL-POINTER-P`.  This is normally protected by a call to
`ARRAY-HEADER-P`, but when it's inlined, the compiler tries to
constant-fold `%ARRAY-FILL-POINTER-P` on an array without such a slot.

Likewise `ARRAY-DISPLACEMENT` calls `%ARRAY-DISPLACED-P`,
`%ARRAY-DATA-VECTOR`, and `%ARRAY-DISPLACEMENT`, and the calls are
protected by `ARRAY-HEADER-P`. So don't constant-fold these either.

Maybe we could also make CONSTANT-FOLD-CALL be smarter about this?

* src/compiler/generic/objdef.lisp
  * Remove flushable from these ref-trans methods.
* src/general-info/release-21d.md
  * Update
* tests/issues.lisp
  * Add tests from the bug reports.
parent 771fd903
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment