GNU bug report logs -
#38486
Compiler does not terminate
Previous Next
Reported by: Zack Marvel <zpmarvel <at> gmail.com>
Date: Wed, 4 Dec 2019 06:21:02 UTC
Severity: normal
Done: Matt Wette <matt.wette <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello,
When compiling the following program, the compiler does not terminate.
(define (find-closest-intersection board)
(let ((cols (vector-length board))
(rows (vector-length (vector-ref board 0))))
(let col-loop ((col 0)
(min-distance 999))
(if (< col cols)
(col-loop
(1+ col)
(let row-loop ((row 0)
(min-distance min-distance))
(if (< row rows)
(row-loop (1+ row) min-distance)
min-distance)))
min-distance))))
Here is the output of the compiler:
$ guile ~/src/advent-of-code/2019/guile_infinite_loop.scm
;;; note: source file
/home/zack/src/advent-of-code/2019/guile_infinite_loop.scm
;;; newer than compiled
/home/zack/.local/src/guile-2.2.6/cache/guile/ccache/2.2-LE-8-3.A/home/zack/src/advent-of-code/2019/guile_infinite_loop.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-auto-compile argument to disable.
;;; compiling /home/zack/src/advent-of-code/2019/guile_infinite_loop.scm
If I flatten the two loops into one, the program compiles. If I use
constants instead of vector sizes, it also compiles.
I can produce this behavior with Guile 2.2.4 and 2.2.6. I'm running
Debian 10 amd64, and I compiled Guile with GCC 8.3.0.
Please let me know if I can provide more information!
Best regards,
Zack Marvel
This bug report was last modified 5 years and 61 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.