diff --git a/binary.cabal b/binary.cabal
--- a/binary.cabal
+++ b/binary.cabal
@@ -1,5 +1,5 @@
 name:            binary
-version:         0.8.0.0
+version:         0.8.0.1
 license:         BSD3
 license-file:    LICENSE
 author:          Lennart Kolmodin <kolmodin@gmail.com>
@@ -41,7 +41,8 @@
                    Data.Binary.Builder.Internal
 
   other-modules:   Data.Binary.Builder.Base,
-                   Data.Binary.Class
+                   Data.Binary.Class,
+                   Data.Binary.Internal
 
   if impl(ghc >= 7.2.1)
     cpp-options: -DGENERICS
@@ -51,6 +52,9 @@
       build-depends: ghc-prim
 
   ghc-options:     -O2 -Wall -fliberate-case-threshold=1000
+
+  if impl(ghc >= 7.11)
+    ghc-options: -Wcompat -Wnoncanonical-monad-instances
 
 -- Due to circular dependency, we cannot make any of the test-suites or
 -- benchmark depend on the binary library. Instead, for each test-suite and
diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,6 +1,11 @@
 binary
 ======
 
+binary-0.8.0.1
+--------------
+
+- Address compiler warnings.
+
 binary-0.8.0.0
 --------------
 
diff --git a/src/Data/Binary/Builder/Base.hs b/src/Data/Binary/Builder/Base.hs
--- a/src/Data/Binary/Builder/Base.hs
+++ b/src/Data/Binary/Builder/Base.hs
@@ -74,15 +74,9 @@
 
 import System.IO.Unsafe as IO ( unsafePerformIO )
 
-#ifdef BYTESTRING_IN_BASE
-import Data.ByteString.Base (inlinePerformIO)
-import qualified Data.ByteString.Base as S
-import qualified Data.ByteString.Lazy.Base as L
-#else
-import Data.ByteString.Internal (inlinePerformIO)
+import Data.Binary.Internal ( accursedUnutterablePerformIO )
 import qualified Data.ByteString.Internal as S
 import qualified Data.ByteString.Lazy.Internal as L
-#endif
 
 #if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)
 import GHC.Base (ord,Int(..),uncheckedShiftRL#)
@@ -204,7 +198,12 @@
       then k buf
       else let !b  = Buffer p (o+u) 0 l
                !bs = S.PS p o u
-           in return $! L.Chunk bs (inlinePerformIO (k b))
+           -- It should be safe to use accursedUnutterablePerformIO here.
+           -- The place in the buffer where we write is determined by the 'b'
+           -- value, and writes should be deterministic. The thunk should not
+           -- be floated out and shared since the buffer references the
+           -- incoming foreign ptr.
+           in return $! L.Chunk bs (accursedUnutterablePerformIO (k b))
 {-# INLINE [0] flush #-}
 
 ------------------------------------------------------------------------
diff --git a/src/Data/Binary/Get/Internal.hs b/src/Data/Binary/Get/Internal.hs
--- a/src/Data/Binary/Get/Internal.hs
+++ b/src/Data/Binary/Get/Internal.hs
@@ -44,12 +44,13 @@
 
 import Foreign
 import qualified Data.ByteString as B
-import qualified Data.ByteString.Internal as B
 import qualified Data.ByteString.Unsafe as B
 
 import Control.Applicative
 import Control.Monad
 
+import Data.Binary.Internal ( accursedUnutterablePerformIO )
+
 #if __GLASGOW_HASKELL__ < 704 && !defined(__HADDOCK__)
 -- needed for (# unboxing #) with magic hash
 -- Do we still need these? Works without on modern GHCs.
@@ -413,7 +414,11 @@
 unsafeReadN !n f = C $ \inp ks -> do
   ks (B.unsafeDrop n inp) $! f inp -- strict return
 
+-- | @readNWith n f@ where @f@ must be deterministic and not have side effects.
 readNWith :: Int -> (Ptr a -> IO a) -> Get a
 readNWith n f = do
-    readN n $ \s -> B.inlinePerformIO $ B.unsafeUseAsCString s (f . castPtr)
+    -- It should be safe to use accursedUnutterablePerformIO here.
+    -- The action must be deterministic and not have any external side effects.
+    -- It depends on the value of the ByteString so the value dependencies look OK.
+    readN n $ \s -> accursedUnutterablePerformIO $ B.unsafeUseAsCString s (f . castPtr)
 {-# INLINE readNWith #-}
diff --git a/src/Data/Binary/Internal.hs b/src/Data/Binary/Internal.hs
new file mode 100644
--- /dev/null
+++ b/src/Data/Binary/Internal.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE CPP #-}
+
+module Data.Binary.Internal 
+ ( accursedUnutterablePerformIO ) where
+
+#if MIN_VERSION_bytestring(0,10,6)
+import Data.ByteString.Internal( accursedUnutterablePerformIO )
+#else
+import Data.ByteString.Internal( inlinePerformIO )
+
+{-# INLINE accursedUnutterablePerformIO #-}
+-- | You must be truly desperate to come to me for help.
+accursedUnutterablePerformIO :: IO a -> a
+accursedUnutterablePerformIO = inlinePerformIO
+#endif
diff --git a/tests/Action.hs b/tests/Action.hs
--- a/tests/Action.hs
+++ b/tests/Action.hs
@@ -38,6 +38,7 @@
   deriving (Show, Eq)
 
 instance Arbitrary Action where
+  arbitrary = fmap Actions (gen_actions False)
   shrink action =
     case action of
       Actions [a] -> [a]
