Heroic constant folding (was micro-optimizing

Dave P. Schaumann dave at cs.arizona.edu
Sat Mar 2 16:00:57 AEST 1991


In article <1991Mar2.010049.21044 at grebyn.com> ckp at 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 at 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



More information about the Comp.lang.c mailing list