[GHC] #12779: isTrue# doesn't work in ghci anymore

#12779: isTrue# doesn't work in ghci anymore -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: #12718 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{#!haskell GHCi, version 8.1.20161028: http://www.haskell.org/ghc/ :? for help Prelude> :set -XMagicHash Prelude> :m + GHC.Types Prelude GHC.Types> isTrue# 123# True Prelude GHC.Types> [1] 3181 segmentation fault ghc-stage2 --interactive }}} This is also the reason why #12718 is segfaulting. I'm currently working on this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12779 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12779: isTrue# doesn't work in ghci anymore -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12718 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by osa1: @@ -13,0 +13,2 @@ + + `isTrue#` is failing in 8.0.1 too. New description: {{{#!haskell GHCi, version 8.1.20161028: http://www.haskell.org/ghc/ :? for help Prelude> :set -XMagicHash Prelude> :m + GHC.Types Prelude GHC.Types> isTrue# 123# True Prelude GHC.Types> [1] 3181 segmentation fault ghc-stage2 --interactive }}} This is also the reason why #12718 is segfaulting. I'm currently working on this. `isTrue#` is failing in 8.0.1 too. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12779#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12779: isTrue# doesn't work in ghci anymore -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12718 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): `isTrue# 123#` isn't allowed. The argument must be `0#` or `1#`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12779#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12779: isTrue# doesn't work in ghci anymore -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12718 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): Documentation of `isTrue#` agrees with that: {{{#!haskell {-# INLINE isTrue# #-} -- | Alias for 'tagToEnum#'. Returns True if its parameter is 1# and False -- if it is 0#. isTrue# :: Int# -> Bool -- See Note [Optimizing isTrue#] isTrue# x = tagToEnum# x }}} but there's also this in the same file: {{{#!haskell {- Note [Optimizing isTrue#] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Current definition of isTrue# is a temporary workaround. We would like to have functions isTrue# and isFalse# defined like this: isTrue# :: Int# -> Bool isTrue# 1# = True isTrue# _ = False isFalse# :: Int# -> Bool isFalse# 0# = True isFalse# _ = False }}} So I'm not sure what's the correct behavior here. Would raising a panic be too costly here? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12779#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC