GNU bug report logs -
#31474
logxor+ash trigger compilation bug?
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 11 Jun 2018 10:28:28 -0400
with message-id <87po0x75yr.fsf <at> netris.org>
and subject line Re: bug#31474: logxor+ash trigger compilation bug?
has caused the debbugs.gnu.org bug report #31474,
regarding logxor+ash trigger compilation bug?
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
31474: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31474
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 <at> 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 <at> 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 <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com
[Message part 3 (message/rfc822, inline)]
Jan Nieuwenhuizen <janneke <at> gnu.org> 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
This bug report was last modified 7 years and 65 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.