Hello,

I'm getting different results when compiling code using -O2 and -O3.

$ cat sr.scm
(define (foo str pos)
  (condition-case
   (string-ref str pos)
   (() "oops")))

(pp (foo "bar" -1))

;; the same, but not calling `foo'
(pp (condition-case
     (string-ref "bar" -1)
     (() "oops")))

$ csc -O2 sr.scm 

$ ./sr
"oops"
"oops"

$ csc -O3 sr.scm

$ ./sr
#\x3
"oops"

$ csc -version
  _______   _     __          
 / ___/ /  (_)___/ /_____ ___ 
/ /__/ _ \/ / __/  '_/ -_) _ \
\___/_//_/_/\__/_/\_\\__/_//_/

Version 2, Build 2 - linux-unix-gnu-unknown - [ dload ]
(c)2000-2005 Felix L. Winkelmann

Enter "chicken -help" for information on how to use it.


It's 2.2 with Felix's patch to extras.scm applied.

Is there something I'm missing?  If you need more information about the
environment, let me know.


Best wishes,
Mario


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to