This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: pure and const functions
- From: Mark Dettinger <mdetting at yahoo dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 29 Apr 2002 09:52:50 -0700 (PDT)
- Subject: Re: pure and const functions
Does the latest GCC really already try to prove functions as pure?
If yes, can anyone point me to the code that does that, please?
And why does it fail to recognize this function as pure:
int square (int n) {
int i,j,result;
result = 0;
for (i=0; i<n; i++)
for (j=0; j<n; j++)
result++;
return result;
}
which clearly is a pure (and even a const) function, right?
-Mark Dettinger
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com