Path: utzoo!attcan!uunet!snorkelwacker!usc!cs.utexas.edu!uwm.edu!uwvax!rang From: rang@cs.wisc.edu (Anton Rang) Newsgroups: comp.lang.misc Subject: Re: Common subexpression optimization Message-ID: Date: 14 Feb 90 16:43:34 GMT References: <14229@lambda.UUCP> <2844@pkmab.se > <767@enea.se> <449@quad.uucp> Sender: news@spool.cs.wisc.edu Organization: UW-Madison CS department Lines: 16 In-reply-to: dts@quad.uucp's message of 12 Feb 90 23:35:50 GMT In article <449@quad.uucp> dts@quad.uucp (David T. Sandberg) writes: >You're right: you don't speak C. Kristoffer's version is a very >common way to do operations like this in C. I've written several >bits of code nearly identical to that in the last week. Of course, if the array is redeclared to a different size, you get interesting side-effects in the pointer versions, which can be rather annoying. For instance, adding a third element to each row (say, to hold a precomputed function of the other two elements later on) will screw up every loop like this. Anton +---------------------------+------------------+-------------+ | Anton Rang (grad student) | rang@cs.wisc.edu | UW--Madison | +---------------------------+------------------+-------------+