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]

Re: Value Range Propagation Pass Status


> I'm more interested in cases where the bounds are not constants
> but where we can glean some information about the limiting values,
> eg,
> 
> assert (count < 256);
> for (i = 0; i < count; i++)
>   subr();

Same problem.  Specifically:

  void
  func(int a)
    {
    int count;
    int i;

    count = a;

    if (count >= 256)
      return;
    for (i = 0; i < count; i++)
      subr();
    }

results in:

BB 2
    reg 26
        min <integer_cst 82984cc -2147483648>     max <integer_cst 8298530 254>

where BB 2 is the top of the loop and reg 26 is i.  The problem is likely
to be solved once I find some time. :-)  In which case the bounds will be
known for both constants and variables with known limiting values.

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