* bug#33216: using custom optimization options eats goops object
@ 2018-10-31 14:51 Jan Nieuwenhuizen
2018-10-31 16:28 ` Jan Nieuwenhuizen
0 siblings, 1 reply; 2+ messages in thread
From: Jan Nieuwenhuizen @ 2018-10-31 14:51 UTC (permalink / raw)
To: 33216
[-- Attachment #1: Type: text/plain, Size: 1534 bytes --]
Hi!
When running `step.scm' (attached) the expected behaviour is exit 0.
Using auto compilation or default optimization options, that's what
happens
--8<---------------cut here---------------start------------->8---
$ rm -f step.go && guile -e '(step)' step.scm
15:39:41 janneke@dundal:~/src/bug-0
--8<---------------cut here---------------end--------------->8---
However, when compiled with a particular set of optimization options
(see attached compile.scm), I get
--8<---------------cut here---------------start------------->8---
$ rm -f step.go && guile -L . -C . compile.scm && guile -L . -C . -e '(step)'
;;; WARNING (buggy (#:eliminate-dead-code? #f #:cse? #f))
Backtrace:
4 (apply-smob/1 #<catch-closure 12356e0>)
In ice-9/boot-9.scm:
705:2 3 (call-with-prompt ("prompt") #<procedure 148f620 at ice-9/eval.scm:330:13 ()> #<procedure default…>)
In ice-9/eval.scm:
619:8 2 (_ #(#(#<directory (guile-user) 12ed140>)))
In oop/goops.scm:
1490:4 1 (cache-miss ())
In unknown file:
0 (scm-error goops-error #f "No applicable method for ~S in call ~S" (#<<generic> .status (1)> (…)) #)
ERROR: In procedure scm-error:
No applicable method for #<<generic> .status (1)> in call (.status ())
[1]15:40:09 janneke@dundal:~/src/bug-0
--8<---------------cut here---------------end--------------->8---
The error message seems to suggest that <node> `one' is now the empty
list.
This is with Guile 2.2.4 from current Guix master.
Greetings,
janneke
[-- Attachment #2: step.scm --]
[-- Type: application/octet-stream, Size: 1081 bytes --]
;; rm -f step.go && guile -L . -C . compile.scm && guile -L . -C . -e '(step)'
(define-module (step)
#:use-module (oop goops)
#:export (main))
(define-class <node> ()
(status #:getter .status #:init-value #f))
(define (main . args)
(let* ((zero (make <node>))
(one (make <node>))
(two (dummy))
(one (if (dummy) one
(if (not (fubar)) one
(let* ((t (const #t))
(foo? (fubar))
;;;; <node> one becomes '() here* without this let
;; (foo (const t))
;;;;
(three (fubar)))
(if (fubar) three
(if (if foo?
(fubar two)
(fubar))
(fubar)
(fubar one (make <node> #:status zero)))))))))
;; * <node> one becomes '()
(.status one)))
(define (dummy . rest)
#t)
[-- Attachment #3: compile.scm --]
[-- Type: application/octet-stream, Size: 665 bytes --]
(define %buggy-optimizations
'(
;;#:partial-eval? #t
;;#:simplify? #f
#:eliminate-dead-code? #f
;;#:prune-top-level-scopes? #f
;;#:contify? #f
;;#:inline-constructors? #f
;;#:specialize-primcalls? #f
;;#:elide-values? #f
;;#:prune-bailouts? #f
;;#:peel-loops? #f
#:cse? #f
;;#:type-fold? #f
;;#:resolve-self-references? #f
;;#:specialize-numbers? #f
;;#:licm? #f
;;#:rotate-loops? #f
;;#:precolor-calls? #f
))
(compile-file "step.scm"
#:output-file "step.go"
#:canonicalization 'absolute
#:opts (warn 'buggy %buggy-optimizations))
[-- Attachment #4: Type: text/plain, Size: 154 bytes --]
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#33216: using custom optimization options eats goops object
2018-10-31 14:51 bug#33216: using custom optimization options eats goops object Jan Nieuwenhuizen
@ 2018-10-31 16:28 ` Jan Nieuwenhuizen
0 siblings, 0 replies; 2+ messages in thread
From: Jan Nieuwenhuizen @ 2018-10-31 16:28 UTC (permalink / raw)
To: 33216
Jan Nieuwenhuizen <janneke@gnu.org> writes:
I get the same with latest stable-2.2
commit d9af6706e8a1a0148d492b222758e49e03d225b7
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-31 16:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31 14:51 bug#33216: using custom optimization options eats goops object Jan Nieuwenhuizen
2018-10-31 16:28 ` Jan Nieuwenhuizen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).