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


> Also, can we use this to ask at anytime whether or not we know a
> specific pseudo cannot be 0?  This will help us do a better job of
> dealing with certain exceptions in gcj.

Currently only a pseudo's min and max values is recorded and that
information is discarded after jumps have been simplified and the
value range pass has completed.  I.e.

  int a;

  if (a < -5)
    return;

  if (a > 5)
    return;

  /* at this point a >= -4 and <= 4 */

  if (a == 0)
    return;

  /* at this point nothing new is recorded about a */

  if (a == -4)
    return;

  /* at this point a >= -3 and <= 4 */

  a += 4;

  /* at this point a >= 1 and <= 8
     so it is known that a isn't zero. */

I'm not sure if this is helpful for what you have in mind.
BTW, the code certainly can be changed to keep the information
around after the value range pass has completed, though the
information is only recorded for the start of a basic block,
not on a per insn basis.  Does that meet your definition
of "anytime"?

Regarding pointers:

  char *a;

  if (a == 0)
    return;

  /* at this point currently nothing is known about a,
     though the existing implementation could probably
     be modified to record that a is not zero. */

  a += 1;

  /* at this point nothing is known about a since the
     pointer could have wrapped. */

Hopefully this helps clarify the current state of things.

BTW, any one have sample code that illustrates the type
of pointer value range propagation of interest?  Isn't
some of this (better) handled by delete_null_pointer_checks?

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