This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: pure and const functions
- From: John Wehle <john at feith dot com>
- To: mdetting at yahoo dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 29 Apr 2002 20:16:00 -0400 (EDT)
- Subject: 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 | |
-------------------------------------------------------------------------