close Warning: Can't synchronize with repository "(default)" ("(default)" is not readable or not a Git repository.). Look in the Trac log for more information.

Opened 15 years ago

Closed 15 years ago

#25 closed defect (fixed)

Compiler bug

Reported by: Raymond Toy Owned by: somebody
Priority: major Milestone:
Component: Core Version: 2008-11
Keywords: compiler Cc:

Description

Reported on cmucl-imp, 2008-10-31

(declaim (optimize (speed 0) (safety 3) (debug 3)))

(defun test-pop-and-return ()
  (loop
    (pop *random-stack*)
    (return)))

When compiled, this causes an internal compiler error from STACK-ANALYZE.

The error happens because NODE-PREV returns NIL instead of a node.

Change History (4)

comment:1 Changed 15 years ago by Raymond Toy

A related bug

(defun foo2 ()
  (catch (make-symbol "CMUCL-DEBUG-CATCH-TAG")
    (make-string 49)))

Same results: STACK-ANALYZE crashes because NODE-PREV is NIL.

comment:2 in reply to:  1 Changed 15 years ago by Raymond Toy

Replying to rtoy:

Correction:

(declaim (optimize (safety 3)))

(defun foo2 ()
  (catch (make-symbol "CMUCL-DEBUG-CATCH-TAG")
    (make-string 49)))

There's no problem if safety < 3.

comment:3 Changed 15 years ago by Raymond Toy

Both of these should be fixed in the 2008-12 snapshot.

I think the compiler was trying not to delete dead code when SAFETY = 3, but was erroneous linking continuations together. Now we do nothing in this case. The dead code remains and is executed and the results are never used. The above examples work fine, and the case of (progn (fboundp 42) t) still works (fboundp triggers an error instead of being deleted as dead code.)

comment:4 Changed 15 years ago by Raymond Toy

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.