Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!snorkelwacker.mit.edu!spool.mu.edu!news.cs.indiana.edu!arizona.edu!arizona!dave From: dave@cs.arizona.edu (Dave P. Schaumann) Newsgroups: comp.lang.c Subject: Re: Heroic constant folding (was micro-optimizing Message-ID: <992@caslon.cs.arizona.edu> Date: 2 Mar 91 05:00:57 GMT References: <10191@dog.ee.lbl.gov> <14522@ganymede.inmos.co.uk> <10450@dog.ee.lbl.gov> <1991Mar2.010049.21044@grebyn.com> Organization: U of Arizona CS Dept, Tucson Lines: 24 In article <1991Mar2.010049.21044@grebyn.com> ckp@grebyn.com (Checkpoint Technologies) writes: |[...]I'd sure like to see a compiler that |could change the following: | |int fib_array[1024]; |[code deleted] | |...into... | |int fib_array[1024] = {1, 1, 2, 3, 5, 8, 13, 21, /* you get the idea */ | |I know, this is asking a LOT. But hey, I can ask, can't I? Do you have any idea what the value of fib_array[1024] is??!!!!! You're asking more than just "a LOT" from the compiler... A quick calculation reveals fib_array[1024] is approximately 2.7 E 213. You'd need a seriously capacious int type to hold that... -- Dave Schaumann dave@cs.arizona.edu 'Dog Gang'! Where do they get off calling us the 'Dog Gang'? I'm beginning to think the party's over. I'm beginning to think maybe we don't need a dog. Or maybe we need a *new* dog. Or maybe we need a *cat*! - Amazing Stories