[ ghc-Bugs-1370885 ] object code blow up by minor source code change

SourceForge.net noreply at sourceforge.net
Thu Dec 1 08:50:36 EST 2005


Bugs item #1370885, was opened at 2005-12-01 14:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1370885&group_id=8032

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Compiler
Group: 6.4.1
Status: Open
Resolution: None
Priority: 5
Submitted By: C Maeder (c_maeder)
Assigned to: Nobody/Anonymous (nobody)
Summary: object code blow up by minor source code change

Initial Comment:
If you unpack the archive and compile the files with
optimization by: 

 time ghc -no-recomp --make -O HasCASL/hacapa.hs

This takes about 5 minutes and generates an unstripped
binary of 4MB.

Apply the (little) patch for HugesPJ.hs -- the one I've
sent before and that is included as "patch" in the
top-level directory. Our (slightly modified) copy of
HughesPJ.hs is Common/Lib/Pretty.hs:

 patch -p0 Common/Lib/Pretty.hs patch

Now compilation takes 7 minutes and the binary gets
size 6 MB. Particularly the file HasCASL/PrintLe.o has
grown from 90 KB to 2 MB. (Compiling HasCASL/PrintLe.hs
takes visibly longer, too)

(Patching can be reversed by:
 patch -p0 -R Common/Lib/Pretty.hs patch
)

This blow-up of object code caused a link failure on
our mac for a final (stripped) binary that should have
a size of around 36 MB.

(The link failure on macs is another issue that may
need attention in the future.)

The data below is obtained with ghc-6.4.1 under linux.

Cheers Christian

maeder at turing:~/haskell/examples> uname -a
Linux turing 2.6.11.4-21.9-default #1 Fri Aug 19
11:58:59 UTC 2005 i686 i686 i386 GNU/Linux
maeder at turing:~/haskell/examples> ghc --version
The Glorious Glasgow Haskell Compilation System,
version 6.4.1
maeder at turing:~/haskell/examples> gcc --version
gcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)
Copyright (C) 2003 Free Software Foundation, Inc.
[...]
maeder at turing:~/haskell/examples> time ghc -no-recomp
--make -O HasCASL/hacapa.hs
Chasing modules from: HasCASL/hacapa.hs
Compiling Common.Lib.State ( ./Common/Lib/State.hs,
./Common/Lib/State.o )
[...]
Compiling Main             ( HasCASL/hacapa.hs,
HasCASL/hacapa.o )
Linking ...

real    6m0.739s
user    5m42.199s
sys     0m9.590s
maeder at turing:~/haskell/examples> ll a.out
HasCASL/PrintLe.o
-rwxr-xr-x  1 maeder wimi 4674747 2005-12-01 14:17 a.out
-rw-r--r--  1 maeder wimi   90308 2005-12-01 14:14
HasCASL/PrintLe.o
maeder at turing:~/haskell/examples> patch -p0
Common/Lib/Pretty.hs patch
patching file Common/Lib/Pretty.hs
Hunk #1 succeeded at 564 (offset -42 lines).
Hunk #2 succeeded at 609 (offset -42 lines).
maeder at turing:~/haskell/examples> time ghc -no-recomp
--make -O HasCASL/hacapa.hs
Chasing modules from: HasCASL/hacapa.hs
Compiling Common.Lib.State ( ./Common/Lib/State.hs,
./Common/Lib/State.o )
[...]
Compiling Main             ( HasCASL/hacapa.hs,
HasCASL/hacapa.o )
Linking ...

real    8m7.962s
user    7m46.492s
sys     0m12.345s
maeder at turing:~/haskell/examples> ll a.out
HasCASL/PrintLe.o
-rwxr-xr-x  1 maeder wimi 6470827 2005-12-01 14:42 a.out
-rw-r--r--  1 maeder wimi 2007272 2005-12-01 14:40
HasCASL/PrintLe.o


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1370885&group_id=8032



More information about the Glasgow-haskell-bugs mailing list