Opened 3 years ago

Last modified 19 months ago

#5522 new bug

mc03 -O -fliberate-case -fspec-constr runs out of memory

Reported by: btutt Owned by: simonpj
Priority: normal Milestone: 7.6.2
Component: Compiler Version: 7.3
Keywords: Cc:
Operating System: Windows Architecture: x86
Type of failure: Compile-time performance bug Difficulty:
Test Case: mc03 Blocked By:
Blocking: Related Tickets:

Description

I noticed that test mc03 runs out of memory compiled with -O -fliberate-case -fspec-constr.

-O + either extra option on its own isn't enough to trigger the issue..

stage2 --info output:

$ ../inplace/bin/ghc-stage2.exe --info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("GCC extra via C opts"," -fwrapv")
 ,("C compiler command","$topdir/../mingw/bin/gcc.exe")
 ,("C compiler flags","")
 ,("ar command","C:/MinGW/msys/1.0/home/bill/ghc-HEAD-github/inplace/mingw/bin/ar.exe")
 ,("ar flags","q")
 ,("ar supports at file","YES")
 ,("touch command","$topdir/touchy.exe")
 ,("dllwrap command","$topdir/../mingw/bin/dllwrap.exe")
 ,("windres command","$topdir/../mingw/bin/windres.exe")
 ,("perl command","$topdir/../perl/perl.exe")
 ,("Project version","7.3.20110927")
 ,("Booter version","7.0.2")
 ,("Stage","2")
 ,("Build platform","i386-unknown-mingw32")
 ,("Host platform","i386-unknown-mingw32")
 ,("Target platform","i386-unknown-mingw32")
 ,("Have interpreter","YES")
 ,("Object splitting supported","YES")
 ,("Have native code generator","YES")
 ,("Support SMP","YES")
 ,("Unregisterised","NO")
 ,("Tables next to code","YES")
 ,("RTS ways","l debug  thr thr_debug thr_l thr_p  dyn debug_dyn thr_dyn thr_debug_dyn")
 ,("Leading underscore","YES")
 ,("Debug on","False")
 ,("LibDir","C:\\MinGW\\msys\\1.0\\home\\bill\\ghc-HEAD-github\\inplace\\lib")
 ,("Global Package DB","C:\\MinGW\\msys\\1.0\\home\\bill\\ghc-HEAD-github\\inplace\\lib\\package.conf.d")
 ,("Gcc Linker flags","[]")
 ,("Ld Linker flags","[]")
 ]

ghc-HEAD was built with BuildFlavor=perf

Attachments (4)

5522.hs (2.1 KB) - added by igloo 2 years ago.
z6.hs (249 bytes) - added by igloo 2 years ago.
partial.core.1.z6 (15.5 KB) - added by igloo 2 years ago.
partial.core.2.z6 (65.7 KB) - added by igloo 2 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 2 years ago by igloo

  • Milestone set to 7.6.1
  • Owner set to igloo
  • Type of failure changed from Compile-time crash to Compile-time performance bug

Thanks for the report.

Reproduced with HEAD in testsuite/tests/deSugar/should_run:

$ ulimit -v 1024000
$ ghc  -fforce-recomp --make mc03 -O -fliberate-case -fspec-constr 
[1 of 1] Compiling Main             ( mc03.hs, mc03.o )
ghc-stage2: out of memory (requested 1048576 bytes)

Changed 2 years ago by igloo

Changed 2 years ago by igloo

Changed 2 years ago by igloo

Changed 2 years ago by igloo

comment:2 Changed 2 years ago by igloo

  • Owner changed from igloo to simonpj

I've attached a cut-down testcase 5522.hs:

$ ulimit -v 1024000
$ ghc -fforce-recomp --make 5522.hs -O -fliberate-case -fspec-constr
[1 of 1] Compiling Foo              ( 5522.hs, 5522.o )
ghc-stage2: out of memory (requested 1048576 bytes)

Also a smaller version of the same pattern, z6.hs, and its core before and after SpecConstr. It looks like the amount of core grows quadratically, due to the way that as well as the original binding (e.g. go_Xdn) we also get a binding specialised for the Int# case (e.g. $sgo_sgm).

So for example, in partial.core.2.z6 there are 7 uses of lvl_scs (which is [4]), and 11 uses of lvl_scu (which is [5]).

Simon, is this the expected behaviour when asking for this specialisation, or is it something that we should fix?

comment:3 Changed 19 months ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2
Note: See TracTickets for help on using tickets.