Subject: bug#31474: closed (Re: bug#31474: logxor+ash trigger compilation bug?)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 11 Jun 2018 14:30:02 +0000

Your bug report

#31474: logxor+ash trigger compilation bug?

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
31474: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31474
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#31474: logxor+ash trigger compilation bug?
From: Mark H Weaver <[email-masked]>
To: Jan Nieuwenhuizen <[email-masked]>
Cc: Andy Wingo <[email-masked]>, [email-masked]
Date: Mon, 11 Jun 2018 10:28:28 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Jan Nieuwenhuizen <[email-masked]> writes:

> Mark H Weaver writes:
>
>> Here's an improved version of my patch.  It's functionally equivalent
>> but with more comprehensible code and more comments.  I think this is
>> ready to push to the stable-2.2 branch.  Comments and suggestions
>> welcome.
>
> I tried it and it works for me.  Thanks a lot!
>
> Also, thanks for the workarounds you suggested, they indeed work without
> this patch.

I pushed the patch as commit 2733e97395db30c6233f79f341959e722b4bd4ff to
the stable-2.2 branch.  I'm closing this bug now, but feel free to
reopen if needed.

     Thanks,
       Mark

Subject: logxor+ash trigger compilation bug?
From: Jan Nieuwenhuizen <[email-masked]>
To: [email-masked]
Date: Wed, 16 May 2018 20:16:31 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi!

Trying to implement bit-fields for MesCC, I stumble upon this.  I was
looking for a bitwise left shift that introduces 1's instead of zeros.

This code

--8<---------------cut here---------------start------------->8---
;; foo.scm
(let* ((set-mask (pk 'set-mask (ash 3 3)))
       (clear-mask (pk 'clear-mask (logxor set-mask -1))))
  (pk 'expected (logxor 24 -1))
  (display clear-mask)
  (newline)
  clear-mask)
--8<---------------cut here---------------end--------------->8---

behaves as I expect when compilation is turned off (compile or
auto-compile behave alike for me)

--8<---------------cut here---------------start------------->8---
19:50:43 janneke@dundal:~/src/mes 
$ guile --no-auto-compile foo.scm

;;; (set-mask 24)

;;; (clear-mask -25)

;;; (expected -25)
-25
--8<---------------cut here---------------end--------------->8---

but when (auto)compiled, look:

--8<---------------cut here---------------start------------->8---
19:50:47 janneke@dundal:~/src/mes 
$ guile foo.scm
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/janneke/src/mes/foo.scm
;;; compiled /home/janneke/.cache/guile/ccache/2.2-LE-8-3.A/home/janneke/src/mes/foo.scm.go

;;; (set-mask 24)

;;; (clear-mask -1)

;;; (expected -25)
-1
--8<---------------cut here---------------end--------------->8---

I'm using guile-2.2.3 from Guix master.

Is this a bug, can you suggest a workaround?

Greetings,
janneke

-- 
Jan Nieuwenhuizen <[email-masked]> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com