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?

Current mainline.

> 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;
> }

Loops are not currently handled.  There is a pending
patch to handle loops with known iteration counts:

  http://gcc.gnu.org/ml/gcc-patches/2002-03/msg01612.html

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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