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]
Other format: [Raw text]

[tree-ssa] Virtual operands of &a[1]?


Hello,

consider the following code:

int *foo(int i)
{
  static int *a[100];
  int **ai = a;

  return ai[1];
}

This is translated into

  ai_1 = &a;
  T.1_2 = ai_1 + 4B;
  #   VUSE <MT.1_3>;
  return *T.1_2;

Dominator optimization makes

  ai_1 = &a;
  #   VUSE <a>;
  T.1_2 = &a[1];
  #   VUSE <a>;
  return a[1];

from it. The VUSE on the 'T.1_2 = &a[1]' statement is IMHO unnecessary
and I would like to get rid of it.  Is it correct to assume that
anything inside ADDR_EXPR never creates VUSEs?

Zdenek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]