Article View: comp.sys.amiga.tech
Article #9182Register variables in C
From: Kevin Oster
Date: Wed, 22 Jun 1988 23:54
Date: Wed, 22 Jun 1988 23:54
26 lines
1575 bytes
1575 bytes
> One thing I have yet to see addressed properly by either Aztec or
>Lattice is the following:
>
> register short i, j, k;
>
> for (i = 0; i < 10; ++i)
> <blah>
> for (j = 0; j < 10; ++j)
> <blah>
> for (k = 0; k < 10; ++k)
> <blah>
>...
> ONLY ONE REGISTER SHOULD BE USED FOR ALL THREE REGISTER VARIABLES!!
This problem could be solved by the programmer. Do not use three variables.
Use just one. Or, don't write in a high-level language at all. Write in
68000! The problem never comes up of an inefficient compiler.
How can you expect the compiler to go to all the trouble of interpreting
the code to see if it can toss away redundant variables ?
FILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILL
FILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILL
FILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILL
FILLFILLFILL
FILL
FILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLFILLF
Technical Details
Message-ID:
<4040@pasteur.Berkeley.Edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!pasteur!cory.Berkeley.EDU!kosterReferences:
<8806212123.AA01328@cory.Berkeley.EDU> <728@applix.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!pasteur!cory.Berkeley.EDU!koster From: koster@cory.Berkeley.EDU (Kevin Oster) Newsgroups: comp.sys.amiga.tech Subject: Register variables in C Summary: Don't expect too much from the compilers Message-ID: <4040@pasteur.Berkeley.Edu> Date: 22 Jun 88 23:54:23 GMT References: <8806212123.AA01328@cory.Berkeley.EDU> <728@applix.UUCP> Sender: news@pasteur.Berkeley.Edu Reply-To: koster@cory.Berkeley.EDU.UUCP (Kevin Oster) Organization: University of California, Berkeley Lines: 26