unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Zack Marvel <zpmarvel@gmail.com>
To: 38486@debbugs.gnu.org
Subject: bug#38486: Compiler does not terminate
Date: Tue, 3 Dec 2019 21:58:00 -0700	[thread overview]
Message-ID: <460c32b1-966a-079d-4187-de63f93c6e5f@gmail.com> (raw)

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





             reply	other threads:[~2019-12-04  4:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04  4:58 Zack Marvel [this message]
2019-12-04  8:43 ` bug#38486: Compiler does not terminate 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=460c32b1-966a-079d-4187-de63f93c6e5f@gmail.com \
    --to=zpmarvel@gmail.com \
    --cc=38486@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).