Revert "fix linker_unload test on Solaris/i386 platform"

This reverts commit 65e5dbcd3971cb3ef5b9073096e5d063034b90c1.
Mark type-rep not as expect_broken when debugged

Thanks to slyfox for noticing this reregression.
fix linker_unload test _FILE_OFFSET_BITS redefined warning on Solaris/i386
fix linker_unload test for ghc configurations with --with-gmp-libraries

The issue is presented in Makefile logic where it attempts to start
linker_unload and pass it HSinteger-gmp library for unload,
but the library name is prefixed with two directories names. The first
is of ghc's integer-gmp/build itself and another is the directory name
passed to --with-gmp-libraries= configure parameter. The testcase then
fails on unloading integer-gmp/build directory thinking that this is
a library to unload. The issue is solved by cuting (head -1) the first
library name from the list and using this for unloading the HSinteger-gmp
library. I use head -1 instead of cut -d ' ' here since ghc may be
installed into the directory with space(s) in its name like in the case
when running validate.
fix T658b/T5776 to use POSIX grep -c instead of GNU's --count
Comments and white space
Move Outputable instance for FloatBind to the data type definition
Tiny refactoring, plus comments; no change in behaviour
Add Output instance for OrdList
Make Core Lint check the let/app invariant

If we have an invariant, Lint should jolly well check it.

(And indeed, adding this test throws up Lint errors that
are fixed in separate patches.)
Don't float into unlifted function arguments

We were inadvertently destroying the let/app invariant,
by floating into an unlifted function argument.
When desugaring Use the smart mkCoreConApps and friends

This is actually the bug that triggered Trac #9390.  We had
an unboxed tuple (# writeArray# ..., () #), and that writeArray#
argument isn't ok-for-speculation, so disobeys the invariant.

The desugaring of unboxed tuples was to blame; the fix is easy.
Make buildToArrPReprs obey the let/app invariant

Vectorise.Generic.PAMethods.buildToArrPReprs was building an expression like
   pvoids# (lengthSels2# sels)
which does not satisfy the let/app invariant.  It should be more like
  case lengthSels2# sels of l -> pvoids# l

This was caught by Core Lint (once it was taught to check for the invariant)
Document the maintenance of the let/app invariant in the simplifier

It's not obvious why the simplifier generates code that correctly satisfies
the let/app invariant.   This patch does some minor refactoring, but the main
point is to document pre-conditions to key functions, namely that the rhs
passed in satisfies the let/app invariant.

There shouldn't be any change in behaviour.
Extensive Notes on can_fail and has_side_effects

In fixing Trac #9390 I discovered that I *still* didn't really understand
what the can_fail and has_side_effects properties of a PrimOp mean, precisely.

The big new things I learned are

* has_side_effects needs to be true only of *write* effects,
  Reads (which are, strictly speaking, effects) don't matter here.

* has_side_effects must be true of primops that can throw a synchronous
  Haskell exception (eg raiseIO#)

* can_fail is true only of primops that can cause an *unchecked* (not
  Haskell) system exception, like divide by zero, or accessing memory
  out of range through an array read or write.

I've documented all this now.  The changes in this patch are only
in comments.
Refactor the handling of case-elimination

Mainly in Simplify.rebuildCase.  The old code wasn't wrong, but I kept
mis-understanding it.  This patch cuts splits out "pure seq" from "strict
let", which makes it much easier to grok.
Add has_side_effets to the raise# primop

According to the definition of has_side_effets in PrimOp,
raise# clearly has side effects!  In practice it makes little
difference becuase the fact that it returns bottom is more
important... but still it's better to say it right.
Test Trac #9390
Fix some typos in recent comments/notes
Give the Unique generated by strings a tag '$', fixes #9413.

Summary:
Previously, we allocated uniques for strings starting at zero, which
means the tag bits in the unique are zero, which means that printing a
Unique for a string will start with a null byte.  This is bad.  So
instead, start our numbering with the tag byte as '$' (as in $tring).
This is hard coded so we don't have to worry about the optimizer
reducing the expression.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: hvr, simonmar, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D123

GHC Trac Issues: #9413