optimized compilation fails with gcc 3.4.3 under solaris

Simon Marlow simonmar at microsoft.com
Tue Nov 23 07:21:57 EST 2004


On 17 November 2004 14:01, Christian Maeder wrote:

> maeder at leo -> uname -a
> SunOS leo 5.8 Generic_117000-05 sun4u sparc SUNW,Sun-Fire-280R
> maeder at leo -> ghc --version
> The Glorious Glasgow Haskell Compilation System, version 6.2.1
> maeder at leo -> gcc -v
> Reading specs from
>
/export/software/mirror/sparc-solaris/lang/bin/../lib/gcc/sparc-sun-sola
ris2.8/3.4.3/specs
> Configured with: ../gcc-3.4.3/configure --prefix=/usr/local/lang
> -program-suffix=_3.4.3 --with-as=/usr/ccs/bin/as
> --with-ld=/usr/ccs/bin/ld --enable-version-specific-runtime-libs
> --enable-languages=c,c++,f77 --enable-shared=libstdc++ --disable-nls
> Thread model: posix
> gcc version 3.4.3
> maeder at leo -> ghc --make Main.hs -O
> Chasing modules from: Main.hs
> Compiling Main             ( Main.hs, Main.o )
> /tmp/ghc14393.hc: In function `__stginit_Main':
> /tmp/ghc14393.hc:5: note: if this code is reached, the program will
> abort /tmp/ghc14393.hc: In function `__stginit_ZCMain':
> /tmp/ghc14393.hc:12: note: if this code is reached, the program will
> abort /tmp/ghc14393.hc: In function `Main_a_entry':
> /tmp/ghc14393.hc:33: note: if this code is reached, the program will
> abort /tmp/ghc14393.hc: In function `Main_main_slow':
> /tmp/ghc14393.hc:49: note: if this code is reached, the program will
> abort /tmp/ghc14393.hc: In function `Main_main_entry':
> /tmp/ghc14393.hc:64: note: if this code is reached, the program will
> abort /tmp/ghc14393.hc: In function `ZCMain_main_slow':
> /tmp/ghc14393.hc:79: note: if this code is reached, the program will
> abort Linking ...
> maeder at leo -> ./a.out
> Illegal Instruction

Ah yes, I remember this.  I think it was my bug report which caused the
gcc folks to implement that warning message :-)  GCC 3.4 is being
terribly helpful by taking a rather extreme interpretation of the term
"undefined behaviour" in the C99 spec to mean "abort".

Unfortunately it looks like I haven't patched GHC to work around it.  I
patched my tree on the sourceforge Sparc machine I was using, but I
can't access that right now (perhaps my account expired).

IIRC, it was a simple change to the type cast in the definition of the
JMP_ macro in ghc/includes/TailCall.h.  Maybe change StgFunPtr to
StgFun?  You'll know when you get it right, because the warning will go
away.

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list