This is the mail archive of the gcc-patches@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]

Re: Patch to support mark_constant_function marking pure functions


Just curious where this patch:

  http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01190.html

is in the queue.  It was originally posted in November and was
updated, retested with the current source tree, and reposted in
August.

The patch allows the compiler to automatically recognize static
pure functions which helps the compiler produce better code.

The long term goal is to have mark_constant_function also handle
functions with simple loops that are known to terminated.  I.e:

  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.

-- 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]