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]

Still has problems: Re: [tree-ssa] USE or VUSE bugs?


I changed my input a little bit. I still see something are no what I
expected.


INPUT:

int a;

int func(int *in, int in2)
{
  char *str;
  int b, c;

  sscanf (str, "%d", &b);

  sscanf (str, "%d %d", &b, &c);

  *in = in2;
  a = c;
}


after rewrite_into_ssa, OUTPUT:

func (in, in2)
{
  const char * str.1;
  char[3] * T.2;
  char * T.3;
  const char * T.4;
  int * b.5;
  const char * str.6;
  char[6] * T.7;
  char * T.8;
  const char * T.9;
  int * b.10;
  int * c.11;
  char * str;
  int b;
  int c;


  #   (*str.1)_4 = VDEF <(*str.1)_3>;
  str.1_2 = (const char *)str_1;
  (void)0;
  (void)0;
  (void)0;

  #   (*b.5)_12 = VDEF <(*b.5)_11>;
  #   .GLOBAL_VAR_14 = VDEF <.GLOBAL_VAR_13>;
  b.5_10 = &b;

  #   (*str.1)_15 = VDEF <(*str.1)_4>;
  #   (*b.5)_17 = VDEF <(*b.5)_12>;
  #   .GLOBAL_VAR_18 = VDEF <.GLOBAL_VAR_14>;
  #   .GLOBAL_VAR_18 = VDEF <.GLOBAL_VAR_14>;
  sscanf (str.1_2, (const char *)(char *)"%d", b.5_10);

  #   (*str.6)_21 = VDEF <(*str.6)_20>;
  str.6_19 = (const char *)str_1;
  (void)0;
  (void)0;
  (void)0;

  #   .GLOBAL_VAR_28 = VDEF <.GLOBAL_VAR_18>;
  b.10_27 = &b;

  #   .GLOBAL_VAR_30 = VDEF <.GLOBAL_VAR_28>;
  c.11_29 = &c;

  #   (*str.6)_31 = VDEF <(*str.6)_21>;
  #   .GLOBAL_VAR_33 = VDEF <.GLOBAL_VAR_30>;
  #   .GLOBAL_VAR_33 = VDEF <.GLOBAL_VAR_30>;
  #   .GLOBAL_VAR_33 = VDEF <.GLOBAL_VAR_30>;
  sscanf (str.6_19, (const char *)(char *)"%d %d", b.10_27, c.11_29);

  #   .GLOBAL_VAR_36 = VDEF <.GLOBAL_VAR_33>;
  #   VUSE <in_35>;
  *in = in2_34;

  #   (*str.1)_37 = VDEF <(*str.1)_15>;
  #   (*b.5)_38 = VDEF <(*b.5)_17>;
  #   .GLOBAL_VAR_39 = VDEF <.GL~OBAL_VAR_36>;
  #   VUSE <.GLOBAL_VAR_36>;
  a = c
}

Please note the last statement "a=c", I hope it has some relation with the
second scanf, i.e. a should be aliased with (*str.6), but acturally not. I
expect I can have # (*str.6)_40 = VDEF <(*str.6)_31> attached to "a=c", or
something similar.

Do I miss something?

Thanks.

Wei


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