This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]