[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#38486: Compiler does not terminate

From: Zack Marvel
Subject: bug#38486: Compiler does not terminate
Date: Tue, 3 Dec 2019 21:58:00 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0


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)
           (1+ col)
           (let row-loop ((row 0)
                          (min-distance min-distance))
             (if (< row rows)
                 (row-loop (1+ row) 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]