Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
01546089
Commit
01546089
authored
34 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Rob made some fixes to the error reporting stuff.
parent
1497e1c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/represent.lisp
+54
-28
54 additions, 28 deletions
compiler/represent.lisp
with
54 additions
and
28 deletions
compiler/represent.lisp
+
54
−
28
View file @
01546089
...
...
@@ -117,7 +117,7 @@
(
error
"~S is not valid as the ~:R ~:[result~;argument~] to the~@
~S VOP, since the TN's primitive type ~S allows SCs:~% ~S~@
~:[which cannot be coerced or loaded into the allowed SCs:~
~% ~S~;~]~:[~;~@
~% ~S~;~
*~
]~:[~;~@
Current cost info inconsistent with that in effect at compile ~
time. Recompile.~%Compilation order may be incorrect.~]"
tn
pos
arg-p
...
...
@@ -129,6 +129,58 @@
incon
)))))
;;; BAD-COERCE-ERROR -- Internal
;;;
;;; Try to give a helpful error message when we fail to do a coercion
;;; for some reason.
;;;
(
defun
bad-coerce-error
(
op
)
(
declare
(
type
tn-ref
op
))
(
let*
((
op-tn
(
tn-ref-tn
op
))
(
op-sc
(
tn-sc
op-tn
))
(
op-scn
(
sc-number
op-sc
))
(
ptype
(
tn-primitive-type
op-tn
))
(
write-p
(
tn-ref-write-p
op
)))
(
multiple-value-bind
(
arg-p
pos
more-p
costs
load-scs
incon
)
(
get-operand-info
op
)
(
declare
(
ignore
costs
more-p
))
(
collect
((
load-lose
)
(
move-lose
))
(
dotimes
(
i
sc-number-limit
)
(
let
((
i-sc
(
svref
*sc-numbers*
i
)))
(
when
(
eq
(
svref
load-scs
i
)
t
)
(
cond
((
not
(
sc-allowed-by-primitive-type
i-sc
ptype
))
(
load-lose
i-sc
))
((
not
(
if
write-p
(
svref
(
sc-move-vops
op-sc
)
i
)
(
svref
(
sc-move-vops
i-sc
)
op-scn
)))
(
move-lose
i-sc
))
(
t
(
error
"Representation selection flamed out for no ~
obvious reason."
))))))
(
unless
(
or
(
load-lose
)
(
move-lose
))
(
error
"Representation selection flamed out for no obvious reason.~@
Try again after recompiling the VM definition."
))
(
error
"~S is not valid as the ~:R ~:[result~;argument~] to VOP:~
~% ~S~%Primitive type: ~S~@
SC restrictions:~% ~S~@
~@[The primitive type disallows these loadable SCs:~% ~S~%~]~
~@[No move VOPs are defined to coerce to these allowed SCs:~
~% ~S~%~]~
~:[~;~@
Current cost info inconsistent with that in effect at compile ~
time. Recompile.~%Compilation order may be incorrect.~]"
op-tn
pos
arg-p
(
template-name
(
vop-info
(
tn-ref-vop
op
)))
(
primitive-type-name
ptype
)
(
mapcar
#'
sc-name
(
listify-restrictions
load-scs
))
(
mapcar
#'
sc-name
(
load-lose
))
(
mapcar
#'
sc-name
(
move-lose
))
incon
)))))
;;; BAD-MOVE-ARG-ERROR -- Internal
;;;
(
defun
bad-move-arg-error
(
val
pass
)
...
...
@@ -138,32 +190,6 @@
val
(
sc-name
(
tn-sc
val
))
pass
(
sc-name
(
tn-sc
pass
))))
#|
;;; ILLEGAL-REPRESENTATION-ERROR -- Internal
;;;
;;; Called when we find that doing an implicit coercion for an operand
;;; results in a representation not allowed by the primitive type.
;;;
(defun illegal-representation-error (ref sc)
(declare (type tn-ref ref))
(let* ((tn (tn-ref-tn ref))
(ptype (tn-primitive-type tn)))
(multiple-value-bind (arg-p pos more-p costs load-scs incon)
(get-operand-info ref)
(declare (ignore more-p costs load-scs))
(error "~S is not valid as the ~:R ~:[result~;argument~] to the~@
~S VOP, since the TN's primitive type ~S disallows coercion to~@
SC ~S. Either the SC restriction is too restrictive, or the ~
operand~@
primitive type restriction is not restrictive enough. ~:[~;~@
Current cost info inconsistent with that in effect at compile ~
time. Recompile.~%Compilation order may be incorrect.~]"
tn pos arg-p
(template-name (vop-info (tn-ref-vop ref)))
(primitive-type-name ptype)
(sc-name sc) incon))))
|#
;;;; VM Consistency Checking:
;;;
...
...
@@ -304,7 +330,7 @@
(
vop
(
tn-ref-vop
op
))
(
node
(
vop-node
vop
))
(
block
(
vop-block
vop
)))
(
dotimes
(
i
sc-number-limit
(
bad-co
sts
-error
op
))
(
dotimes
(
i
sc-number-limit
(
bad-co
erce
-error
op
))
(
let
((
i-sc
(
svref
*sc-numbers*
i
)))
(
when
(
and
(
eq
(
svref
scs
i
)
t
)
(
sc-allowed-by-primitive-type
i-sc
ptype
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment