Steel Bank Common Lisp

Compiler failure on EXPT expression due to type derivation problems

Reported by Lutz Euler on 2011-08-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
High
Unassigned

Bug Description

When entering the following expression at the REPL
the compiler throws an error, while I expected the
expression to be compiled and executed without errors:

(dotimes (i 1)
  (expt 10 (expt 7 (- 2 i))))

debugger invoked on a SIMPLE-TYPE-ERROR in thread #<THREAD
                                                    "initial thread" RUNNING
                                                     {1002901721}>:
  Too large to be represented as a SINGLE-FLOAT:
  10000000000000000000000000000000000000000000000000

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

((LABELS SB-BIGNUM::CHECK-EXPONENT)
 #<unavailable argument>
 #<unavailable argument>
 #<unavailable argument>)
0] backtrace

0: ((LABELS SB-BIGNUM::CHECK-EXPONENT)
    #<unavailable argument>
    #<unavailable argument>
    #<unavailable argument>)
1: ((LABELS SB-BIGNUM::FLOAT-FROM-BITS)
    #<unavailable argument>
    #<unavailable argument>)
2: (SB-KERNEL:%SINGLE-FLOAT 10000000000000000000000000000000000000000000000000)
3: (SB-C::BOUND-FUNC
    #<FUNCTION FLOAT>
    10000000000000000000000000000000000000000000000000)
4: (SB-C::FIXUP-INTERVAL-EXPT
    #S(SB-C::INTERVAL
       :LOW 1
       :HIGH 10000000000000000000000000000000000000000000000000)
    #<unavailable argument>
    #S(SB-C::INTERVAL :LOW 0 :HIGH 49)
    #<SB-KERNEL:NUMERIC-TYPE (INTEGER 10 10)>
    #<SB-KERNEL:NUMERIC-TYPE (RATIONAL 0 49)>)
5: (SB-C::MERGED-INTERVAL-EXPT
    #<SB-KERNEL:NUMERIC-TYPE (INTEGER 10 10)>
    #<SB-KERNEL:NUMERIC-TYPE (RATIONAL 0 49)>)
6: ((FLET SB-C::DERIVER)
    #<SB-KERNEL:NUMERIC-TYPE (INTEGER 10 10)>
    #<SB-KERNEL:NUMERIC-TYPE (RATIONAL 0 49)>
    NIL)
7: (SB-C::TWO-ARG-DERIVE-TYPE
    #<SB-C::LVAR 1 {10032F3431}>
    #<SB-C::LVAR 2 {10032F35E1}>
    #<FUNCTION SB-C::EXPT-DERIVE-TYPE-AUX>
    #<FUNCTION EXPT>
    T)
8: [...]

This is on SBCL 1.0.50.9-8f1d4a2, x86-64, Linux.

Lutz Euler (lutz-euler) on 2011-08-01
tags: added: compiler types
Stas Boukarev (stassats) wrote :

Slightly reduced test-case:
(lambda (i)
  (declare (unsigned-byte i))
  (expt 10 (expt 7 (- 2 i))))

Changed in sbcl:
status: New → Triaged
importance: Undecided → High
Paul Khuong (pvk) on 2011-08-14
Changed in sbcl:
assignee: nobody → Paul Khuong (pvk)
status: Triaged → In Progress
Paul Khuong (pvk) wrote :

Fixed in a7b24b5 Handle SIMPLE-TYPE-ERROR when propagating bounds.

Changed in sbcl:
status: In Progress → Fix Committed
assignee: Paul Khuong (pvk) → nobody
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers