deleting unreachable code inside inlined functions

Bug #509023 reported by Stas Boukarev
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Low
Unassigned

Bug Description

Compiling the following file results in some weird code deletion notes. This is very annoying.

(declaim (inline inlined))
(defun inlined (n)
  (if (evenp n)
      (+ 1 n)
      (+ 2 n))) ;; note: deleting unreachable code

(defun test-1 ()
  (inlined 2))

;;; when inlined function is in a different file
(defun test-2 (number)
  (mod number 10)) ;; note: deleting unreachable code

(defun test-3 (n)
  (mod n 10)) ;; but no note here, since it doesn't share a variable named "number" with MOD

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

In the first case it would be good to give the code deletion note for "INLINED in TEST-1" or equivalent -- or possibly even elide it completely. I'm not entirely sure I've ever seen a code deletion note along these lines that was actually useful.

In the second case MOD is to blame -- it should not used NUMBER as a name. (Or the heuristic is to blame, but since I don't have a better idea to offer...)

Changed in sbcl:
status: New → Confirmed
importance: Undecided → Low
tags: added: compiler
Stas Boukarev (stassats)
tags: added: deletion-note
Stas Boukarev (stassats)
Changed in sbcl:
status: Confirmed → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.