[GHC] #490: object code blow up by minor source code change
GHC
trac at galois.com
Wed Jan 4 10:39:16 EST 2006
#490: object code blow up by minor source code change
-----------------------+----------------------------------------------------
Reporter: c_maeder | Owner: simonpj
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.4.1
Severity: normal | Resolution: None
Keywords: | Os: Unknown
Difficulty: Unknown | Architecture: Unknown
-----------------------+----------------------------------------------------
Changes (by simonmar):
* architecture: => Unknown
* difficulty: => Unknown
* status: assigned => new
* owner: nobody => simonpj
* os: => Unknown
Old description:
> {{{
> 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
>
> }}}
New description:
{{{
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
}}}
--
Ticket URL: <http://cvs.haskell.org/trac/ghc/ticket/490>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list