Patch to support mark_constant_function marking pure functions

Jan Hubicka jh@suse.cz
Fri Sep 21 04:41:00 GMT 2001


>   static int
>   subr (int a[3], int b[3])
>     {
>     int c;
>     int i;
>     int j;
> 
>     c = 0;
>     for (i = 0; i < 3; i++)
>       for (j = 0; j < 3; j++)
>         c += a[i] * b[j];
>     }
> 
> is a pure function.
It should not be too long term now, as loop optimizer marks every loop
with known iteration counts by "loop iterations" heuiristics, so theoretically
all you need to do is to verify that each loop contains such note IMO.

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



More information about the Gcc-patches mailing list