Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ukma!uflorida!novavax!hcx1!tom From: tom@ssd.csd.harris.com (Tom Horsley) Newsgroups: comp.sys.m88k Subject: Re: Information wanted on m88000 Risc workstations Message-ID: Date: 15 Jan 90 12:39:42 GMT References: <641@s5.Morgan.COM> <25A64468.11498@paris.ics.uci.edu> <648@s5.Morgan.COM> <1879@xyzzy.UUCP> <2811@yogi.oakhill.UUCP> <25AFDC1A.11327@paris.ics.uci.edu> Sender: news@hcx1.UUCP Organization: Harris Computer Systems Division Lines: 57 In-reply-to: rfg@ics.uci.edu's message of 14 Jan 90 01:55:38 GMT In article <25AFDC1A.11327@paris.ics.uci.edu> rfg@ics.uci.edu (Ron Guilmette) writes: >entire address space. For example: > { > char array[100]; > char *end = &array[99]; > char *p = array; > > while (p <= end) > *p = ' '; > } > >Guess where p always points to! Now guess where end always points to. >You can work your way up to significantly more complex examples from here. This is absolutely true, and symbolic execution is a well know (if high overhead) way of squeezing information like this out of the source code. (We use a form of it in our Ada compilers to eliminate constraint checks we can prove are not required). But I can make up examples too: void matmul(a,b,c,n,m) double * a; double * b; double * c; int n,m; { ... } Guess where a, b, and c, always point to! Unless I have a global program database and I can compile the matmul routine knowing everything about every point it is called, the only guess I can make is "somewhere within the address space of the machine". The ultimate fanatic compiler might consider generating two routine bodies, one with aliasing between arguments and one without, then throw in some runtime checks for array overlap, and just jump to the "best" body. But be careful, you are liable to introduce more overhead with the runtime checks than you save by picking the correct body (particularly if the arguments always overlap). Deciding which optimizations are profitable is the hardest problem in engineering a good compiler. Both of these are legitimate example programs, in one case a smart compiler could do a good job, in the other case it is out of luck. I am interested in getting good performance out of *all* compiled code, not just examples which happen to work well for the machine. I don't want to argue about which example is "more realistic", the fact is, they are both "realistic". I don't want anyone to claim that I said you can't generate good code for the 88k, sometimes you can generate fantastically good code for it, but sometimes you can't. -- ===================================================================== domain: tahorsley@ssd.csd.harris.com USMail: Tom Horsley uucp: ...!novavax!hcx1!tahorsley 511 Kingbird Circle or ...!uunet!hcx1!tahorsley Delray Beach, FL 33444 ======================== Aging: Just say no! ========================