unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#38486: Compiler does not terminate
@ 2019-12-04  4:58 Zack Marvel
  2019-12-04  8:43 ` tomas
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Zack Marvel @ 2019-12-04  4:58 UTC (permalink / raw)
  To: 38486

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-23 16:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04  4:58 bug#38486: Compiler does not terminate Zack Marvel
2019-12-04  8:43 ` tomas
2020-03-21 20:32 ` bug#38486: compile livelock Matt Wette
2020-03-21 20:57 ` bug#38486: try all options Matt Wette
2020-03-21 21:42 ` bug#38486: hang Matt Wette
2020-03-22  2:43 ` bug#38486: specialize-numbers.scm: compute-significant-bits Matt Wette
2020-03-23 16:08 ` bug#38486: done Matt Wette

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).