Ticket #7270 (closed bug: fixed)
Incorrect optimization with Data.ByteString.append
| Reported by: | ocheron | Owned by: | duncan |
|---|---|---|---|
| Priority: | highest | Milestone: | 7.6.2 |
| Component: | libraries (other) | Version: | 7.6.1 |
| Keywords: | Cc: | hackage.haskell.org@…, conrad@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Incorrect result at runtime | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
The following program does not give the same result with -O2 and without:
import qualified Data.ByteString as B
main = let a = B.singleton 65 in print (func a a)
func y z = B.append r s
where
r = B.map (succ) x
s = B.map (succ . succ) x
x = B.append y z
Result observed with GHC 7.6.1 (bytestring-0.10.0.0):
$ ghc --make test -fforce-recomp && ./test [1 of 1] Compiling Main ( test.hs, test.o ) Linking test ... "BBCC" $ ghc --make test -fforce-recomp -O2 && ./test [1 of 1] Compiling Main ( test.hs, test.o ) Linking test ... "CCCC"
Change History
Note: See
TracTickets for help on using
tickets.
