Re: [GHC] #7411: Exceptions are optimized away in certain situations

#7411: Exceptions are optimized away in certain situations
-------------------------------------+-------------------------------------
Reporter: SimonHengel | Owner: tdammers
Type: bug | Status: new
Priority: high | Milestone: 8.6.1
Component: Compiler | Version: 7.6.1
Resolution: | Keywords: seq, deepseq,
| evaluate, exceptions
Operating System: Linux | Architecture: x86_64
| (amd64)
Type of failure: Incorrect result | Test Case:
at runtime | simplCore/should_fail/T7411
Blocked By: | Blocking:
Related Tickets: #5129 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by tdammers):
Ran a few test, and I'm getting perplexing results.
First of all, a full GHC build from scratch, with `-fno-state-hack`
everywhere, gives mixed results:
Regular profiling build:
{{{
real 66m1.181s
user 118m55.812s
sys 6m9.724s
}}}
Profiling build with `-fno-state-hack` enabled:
{{{
real 66m25.030s
user 119m48.580s
sys 6m7.568s
}}}
So the difference is small, `real` and `sys` (which, I believe, is what
counts) slightly in favor of removing the state hack, `user` in favor of
keeping it.
I've also done `nofib` runs with both compilers, also enabling / disabling
the state hack accordingly; however it turns out that disabling the state
hack causes `nofib` to fail:
{{{
------------------------------------------------------------------------
== make all --no-print-directory;
in /home/tobias/well-typed/devel/ghc/HEAD/nofib/shootout/fasta
------------------------------------------------------------------------
HC = /home/tobias/well-typed/devel/ghc/HEAD/inplace/bin/ghc-stage2
HC_OPTS = -O2 -Rghc-timing -H32m -hisuf hi -fno-state-hack -O2 -rtsopts
-O2 -XBangPatterns -XOverloadedStrings -package bytestring
RUNTEST_OPTS = -ghc-timing
==nofib== fasta: time to compile Main follows...
/home/tobias/well-typed/devel/ghc/HEAD/inplace/bin/ghc-stage2 -O2 -Rghc-
timing -H32m -hisuf hi -fno-state-hack -O2 -rtsopts -O2 -XBangPatterns
-XOverloadedStrings -package bytestring -c Main.hs -o Main.o
Main.hs:30:1: warning: [-Wtabs]
Tab character found here, and in 13 further locations.
Please use spaces instead.
|
30 | let !k = min modulus (floor (fromIntegral modulus *
(p::Float) + 1))
| ^^^^^^^^
<
participants (1)
-
GHC