A simple case of HEAD producing worse code than 5.00.2

Simon Peyton-Jones simonpj@microsoft.com
Fri, 7 Sep 2001 08:04:23 -0700


Excellent point.

I've fixed this with my recent commit.  I hope.

Simon

| -----Original Message-----
| From: Marcin 'Qrczak' Kowalczyk [mailto:qrczak@knm.org.pl]=20
| Sent: 24 July 2001 20:20
| To: cvs-ghc@haskell.org
| Subject: A simple case of HEAD producing worse code than 5.00.2
|=20
|=20
| module Test where
| foo:: Int
| foo =3D foldl (+) 0 [1,2,3]
|=20
|=20
| ghc-5.00.2 produced the following STG code of the main loop:
|=20
| Test.$wlgo =3D
|     \r [ww w]
| 	case w of wild {
| 	  PrelBase.: x xs1 ->
| 	      case x of wild1 {
| 		PrelBase.I# y ->
| 		    case +# [ww y] of sat_sMV { DEFAULT ->=20
| Test.$wlgo sat_sMV xs1 };
| 	      };
| 	  PrelBase.[] -> PrelBase.I# [ww];
| 	};
|=20
|=20
| HEAD produces the following:
|=20
| Test.$wlgo =3D
|     \r [w ww w1]
| 	case w1 of wild {
| 	  PrelBase.: x xs1 ->
| 	      case w of wild1 {
| 		PrelBase.I# x1 ->
| 		    case x of wild11 {
| 		      PrelBase.I# y ->
| 			  case +# [x1 y] of a {
| 			    DEFAULT ->
| 				let { sat_sWi =3D NO_CCS PrelBase.I#! [a];
| 				} in  Test.$wlgo sat_sWi a xs1
| 			  };
| 		    };
| 	      };
| 	  PrelBase.[] -> w;
| 	};
|=20
| --=20
|  __("<  Marcin Kowalczyk * qrczak@knm.org.pl=20
| http://qrczak.ids.net.pl/  \__/
|   ^^                     =20
| SYGNATURA ZAST=CAPCZA
| QRCZAK
|=20
|=20
| _______________________________________________
| Cvs-ghc mailing list
| Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc
|=20
|=20