GNU bug report logs - #16535
Compiler bug ?

Previous Next

Package: emacs;

Reported by: Fabrice Popineau <fabrice.popineau <at> gmail.com>

Date: Fri, 24 Jan 2014 15:05:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Fabrice Popineau <fabrice.popineau <at> gmail.com>
Subject: bug#16535: closed (Re: Compiler bug ?)
Date: Fri, 24 Jan 2014 23:36:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#16535: Compiler bug ?

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

The explanation is attached below, along with your original report.
If you require more details, please reply to 16535 <at> debbugs.gnu.org.

-- 
16535: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16535
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Fabrice Popineau <fabrice.popineau <at> gmail.com>
Cc: 16535-done <at> debbugs.gnu.org
Subject: Re: Compiler bug ?
Date: Fri, 24 Jan 2014 15:35:21 -0800
On 01/24/2014 03:06 PM, Fabrice Popineau wrote:
> Actually, afaik BITS_PER_ULL == BITS_PER_BITS_WORD

Ah, OK, thanks for following up. It looks like the negated-comparison 
bug caused undefined behavior due to integer overflow in 
count_one_bits_word; once that happens it's anybody's guess what 
compilers will do; maybe you hit the jackpot. Anyway, the Emacs bug is 
fixed (and there doesn't seem to have been a compiler bug) so I'll close 
this report.

[Message part 3 (message/rfc822, inline)]
From: Fabrice Popineau <fabrice.popineau <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Compiler bug ?
Date: Fri, 24 Jan 2014 16:03:17 +0100
[Message part 4 (text/plain, inline)]
I hit a bug while compiling Gnu Emacs trunk development.

The following test :
 passed    17/1152  bool-vector-count-population-1-nil
fails unless I apply the following patch :

 === modified file 'src/data.c'
--- src/data.c  2014-01-03 06:47:27 +0000
+++ src/data.c  2014-01-24 14:59:16 +0000
@@ -3012,8 +3012,10 @@
     {
       int i = 0, count = 0;
       while (count += count_one_bits_ll (w),
-            BITS_PER_BITS_WORD <= (i += BITS_PER_ULL))
+            BITS_PER_BITS_WORD <= i) {
+       i += BITS_PER_ULL;
        w = shift_right_ull (w);
+      }
       return count;
     }
 }

This is with :
$ gcc --version
gcc.exe (Rev6, Built by MSYS2 project) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Given the nature of the patch, I don't think it is specific of th MinGW64
gcc version.

Regards,

Fabrice Popineau
[Message part 5 (text/html, inline)]

This bug report was last modified 11 years and 178 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.