chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] slightly more optimistic copy-propagation


From: Felix
Subject: Re: [Chicken-hackers] [PATCH] slightly more optimistic copy-propagation
Date: Mon, 01 Oct 2012 20:02:08 +0200 (CEST)

> 
> The patch looks good to my untrained eyes, but for some reason it causes
> the compiler to hang and burn CPU after it was recompiled with itself.
> Try it: compile & install, make spotless, compile & install again, then
> run "make check" or compile any Scheme file.

The second part of the patch turns out to be too optimistic. Strictly
speaking it is correct, but it may be confusing. The code that caused
the loop was this:

(set! ##sys#user-read-hook
  (let ([old-hook ##sys#user-read-hook])
    (lambda (char port)
      (if (char=? #\> char)            
          (let* ((_ (read-char port))           ; swallow #\>
                 (text (scan-sharp-greater-string port)))
            `(declare (foreign-declare ,text)) )
          (old-hook char port) ) ) ) )

The call to "old-hook" was replaced by "##sys#user-read-hook" which
loops forever. Since "local" mode assumes that toplevel variables used
in this compilation unit are not changed somewhere else, this is
correct, but may cause bugs that are extremely hard to figure out.

Note that "##sys#user-read-hook" is already declared "not inline" to
prevent inlining - also something caused by the assumptions done by
"local" mode (which is enabled by "-O3").

So this change is dropped - too dangerous.


cheers,
felix



reply via email to

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