There was a terrible typo in this patch; I wrote "env"
instead of "env1".
Mon Jan 31 11:35:29 GMT 2011 simonpj@microsoft.com
* Improve Simplifier and SpecConstr behaviour
Anyway, this fix is essential to make it work properly.
Thanks to Max for spotting the problem (again).
live_case_bndr = not (isDeadBinder case_bndr)
env1 | Var v <- scrut = extendValEnv env v cval
| otherwise = env -- See Note [Add scrutinee to ValueEnv too]
- env2 | live_case_bndr = extendValEnv env case_bndr cval
+ env2 | live_case_bndr = extendValEnv env1 case_bndr cval
| otherwise = env1
alt_bndrs' | case scrut of { Var {} -> True; _ -> live_case_bndr }