Hi everybody!
I'm working on a pass and I need to handle some pointer expressions.
For example, I have this C-code:
  int v[1000];
  int *p;  
  p = &v[10];

The problem is that, when I'm trying to parse "p = &v[10];", I'm not able to 
get the array offset (10 in this case).

Namely, for a given statement like "p = &v[10]", I need to get:
  array:  v  (I can do that)
  offset: 10

Here is the code I am working on:
  op0 = gimple_op (stmt, 0);
  op1 = gimple_op (stmt, 1);
  
  if (gimple_assign_rhs_code (stmt) == ADDR_EXPR)
    {
      base = get_base_address (TREE_OPERAND (op1, 0)); // the array v, OK
      offset = // ???

How can I do?

Max




Reply via email to