#1603: a miscompilation of (`rem` 0x40000000)::Int with -O -fvia-C
--------------------------+-------------------------------------------------
 Reporter:  Isaac Dupree  |          Owner:          
     Type:  bug           |         Status:  new     
 Priority:  normal        |      Milestone:  6.10.1  
Component:  None          |        Version:  6.8.1   
 Severity:  normal        |     Resolution:          
 Keywords:                |     Difficulty:  Unknown 
 Testcase:  numeric/1603  |   Architecture:  Multiple
       Os:  Multiple      |  
--------------------------+-------------------------------------------------
Changes (by igloo):

  * milestone:  Not GHC => 6.10.1

Comment:

 gcc looks fixed now:
 {{{
 $ cat q.c

 #include <stdio.h>

 int f(unsigned int x)
 {
     printf("%x %d\n", x, (int)x);
     return ((int)x) % 4;
 }

 int main(int argc, char *argv[])
 {
     printf("%d\n", f((unsigned int)(-1)));
     return 0;
 }
 $ gcc-4.1 q.c -Wall -o q && ./q
 ffffffff -1
 3
 $ gcc-4.2 q.c -Wall -o q && ./q
 ffffffff -1
 -1
 $ gcc-4.2 --version
 gcc-4.2 (GCC) 4.2.4 20080512 (prerelease) (Debian 4.2.3-6)
 Copyright (C) 2007 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.
 }}}
 We should confirm the test passes with ghc and stop skipping it.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1603#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to