[project @ 2002-01-28 16:52:37 by simonpj]
authorsimonpj <unknown>
Mon, 28 Jan 2002 16:52:37 +0000 (16:52 +0000)
committersimonpj <unknown>
Mon, 28 Jan 2002 16:52:37 +0000 (16:52 +0000)
commit0d62bdb2c5b17caf2595855f4dd30b65e6a70aeb
tree618fb1cdc0d4331a411d8f976c42a053242c080c
parent6d550803dcc87d017586208024653672401093d2
[project @ 2002-01-28 16:52:37 by simonpj]
----------------------
Zero-constructor types
----------------------

If we have

data T
data S = MkS !T

we were getting a crash in the compiler because ctrlRetConvAlg
didn't know what to do for zero-constructor types.

This fix arbitrarily says that they use a non-vectored return,
which fixes the crash.  (Since they only have bottom values,
the return never gets exercised, but GC and exception handling
should work.)

What is still unclear is how we handle data types that are defined
with zero constructors in an hi-boot file.  I think that Bad Things
may well happen if you do a 'seq' on them before we get up to the
definition.  (e.g. as a result of this fix we'll say "unvectored"
whereas the truth may be "vectored".)  This obviously doesn't happen
much (because at present we'd get a compiler crash in ctrlRetConvAlg,
but we should look into it.
ghc/compiler/codeGen/CgRetConv.lhs