X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcodeGen%2FCgRetConv.lhs;h=f3ef813e0739ebcb0fb641ee201fcffdf2f2c4a8;hb=643a2f7089ce22012df23c161702f9e6b6da6792;hp=0b72ebeb4e064fb131f4734a12de76f729ea3b0a;hpb=00fe57d46c18e83674cc17c77643164289abdef5;p=ghc-hetmet.git diff --git a/ghc/compiler/codeGen/CgRetConv.lhs b/ghc/compiler/codeGen/CgRetConv.lhs index 0b72ebe..f3ef813 100644 --- a/ghc/compiler/codeGen/CgRetConv.lhs +++ b/ghc/compiler/codeGen/CgRetConv.lhs @@ -1,7 +1,7 @@ % % (c) The GRASP Project, Glasgow University, 1992-1998 % -% $Id: CgRetConv.lhs,v 1.29 2000/11/14 17:41:04 sewardj Exp $ +% $Id: CgRetConv.lhs,v 1.31 2002/01/28 16:52:37 simonpj Exp $ % \section[CgRetConv]{Return conventions for the code generator} @@ -58,12 +58,16 @@ ctrlReturnConvAlg :: TyCon -> CtrlReturnConvention ctrlReturnConvAlg tycon = case (tyConFamilySize tycon) of - 0 -> pprPanic "ctrlRetConvAlg" (ppr tycon) size -> -- we're supposed to know... if (size > (1::Int) && size <= mAX_FAMILY_SIZE_FOR_VEC_RETURNS) then VectoredReturn size else - UnvectoredReturn size + UnvectoredReturn size + -- NB: unvectored returns Include size 0 (no constructors), so that + -- the following perverse code compiles (it crashed GHC in 5.02) + -- data T1 + -- data T2 = T2 !T1 Int + -- The only value of type T1 is bottom, which never returns anyway. \end{code} %************************************************************************ @@ -77,6 +81,8 @@ dataReturnConvPrim :: PrimRep -> MagicId dataReturnConvPrim IntRep = VanillaReg IntRep (_ILIT 1) dataReturnConvPrim WordRep = VanillaReg WordRep (_ILIT 1) +dataReturnConvPrim Int32Rep = VanillaReg Int32Rep (_ILIT 1) +dataReturnConvPrim Word32Rep = VanillaReg Word32Rep (_ILIT 1) dataReturnConvPrim Int64Rep = LongReg Int64Rep (_ILIT 1) dataReturnConvPrim Word64Rep = LongReg Word64Rep (_ILIT 1) dataReturnConvPrim AddrRep = VanillaReg AddrRep (_ILIT 1)