Opened 6 years ago

Last modified 6 years ago

#1989 closed bug

GHC-6.8.1 fails to reproduce itself on amd64/FreeBSD-7.0 — at Initial Version

Reported by: wb.kloke Owned by:
Priority: normal Milestone: 6.8.3
Component: Compiler Version: 6.8.2
Keywords: Cc:
Operating System: FreeBSD Architecture: x86_64 (amd64)
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I am trying to build a native amd64 compiler on FreeBSD. At the bootstrap stage I use the -i386
compiler as ghc: This works to stage1. The stage1 compiler is usable in a limited way. But the stage2 compiler built with this fails very early (before even complaining about missing -B options, if started naked).

Ex.:
/home/wb.local/ghc-6.8.2 0$ compiler/stage2/ghc-6.8.2
Segmentation fault: 11 (core dumped)
wb@yorikke:ttyp2
/home/wb.local/ghc-6.8.2 0$ compiler/stage1/ghc-6.8.2
ghc-6.8.2: missing -B<dir> option

The most reproducable misbehaviour of the stage1 compiler is the unability to run test arith003. The value minInt is converted to a nonprintable 1-char string in the int_ops part. Most other results, including the multiple precision tests, look better than the output from x86-64-openbsd (as published with the 6.6.1-testsuite). It looks as if there is a specific problem with bit pattern 0x8000000000000000L. If I change the source code to avoid this pattern (minInt -> minInt+1) the error does not occur.

First lines of arith003 output:

(+) 0 0 = 0
(+) 0 1 = 1
(+) 0 -1 = -1
(+) 0 2 = 2
(+) 0 -2 = -2
(+) 0 -<FC>8 = -<FC>8
(+) 0 9223372036854775807 = 9223372036854775807
(+) 1 0 = 1
(+) 1 1 = 2
(+) 1 -1 = 0
(+) 1 2 = 3
(+) 1 -2 = -1
(+) 1 -<FC>8 = -9223372036854775807
(+) 1 9223372036854775807 = -<FC>8
(+) -1 0 = -1
(+) -1 1 = 0
(+) -1 -1 = -2
(+) -1 2 = 1
(+) -1 -2 = -3
(+) -1 -<FC>8 = 9223372036854775807
(+) -1 9223372036854775807 = 9223372036854775806
(+) 2 0 = 2
(+) 2 1 = 3
(+) 2 -1 = 1
(+) 2 2 = 4
(+) 2 -2 = 0
(+) 2 -<FC>8 = -9223372036854775806
(+) 2 9223372036854775807 = -9223372036854775807
(+) -2 0 = -2
(+) -2 1 = -1
(+) -2 -1 = -3
(+) -2 2 = 0
(+) -2 -2 = -4
(+) -2 -<FC>8 = 9223372036854775806
(+) -2 9223372036854775807 = 9223372036854775805
(+) -<FC>8 0 = -<FC>8
(+) -<FC>8 1 = -9223372036854775807
(+) -<FC>8 -1 = 9223372036854775807
(+) -<FC>8 2 = -9223372036854775806
(+) -<FC>8 -2 = 9223372036854775806
(+) -<FC>8 -<FC>8 = 0
(+) -<FC>8 9223372036854775807 = -1
(+) 9223372036854775807 0 = 9223372036854775807
(+) 9223372036854775807 1 = -<FC>8
(+) 9223372036854775807 -1 = 9223372036854775806
(+) 9223372036854775807 2 = -9223372036854775807
(+) 9223372036854775807 -2 = 9223372036854775805
(+) 9223372036854775807 -<FC>8 = -1
(+) 9223372036854775807 9223372036854775807 = -2
...

Change History (0)

Note: See TracTickets for help on using tickets.