public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [tree-ssa] USE or VUSE bugs?
@ 2003-04-28  4:49 Wei Liu
  2003-04-28  5:22 ` Daniel Berlin
  2003-04-28  5:57 ` Diego Novillo
  0 siblings, 2 replies; 14+ messages in thread
From: Wei Liu @ 2003-04-28  4:49 UTC (permalink / raw)
  To: gcc

I have a very simple kernel as follows. The problem is, for statement
a=b+c, there is no USE or VUSE I can get from get_ops and get_vops. So
this statement seems to me no use operands. It is really weird, because I
suppose I can all operands from get_ops and get_vops.

Any suggestions are greatly appreciated. Thanks.

---------------------------------------------
void foo1 (const char *);
int foo2(float *in, float *in2);
float a;


int func(int *in, int in2)
{
  float b, c;
  int i;

  for (i = 0; i < 10; i++)
    {
      foo1("yes");
      foo2 (&b, &c);

      *in = in2;
      a = b + c;
    }
}


=============================
Sincerely,
Wei Liu


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [tree-ssa] USE or VUSE bugs?
  2003-04-28  4:49 [tree-ssa] USE or VUSE bugs? Wei Liu
@ 2003-04-28  5:22 ` Daniel Berlin
  2003-04-28  5:35   ` Wei Liu
  2003-04-28  5:57 ` Diego Novillo
  1 sibling, 1 reply; 14+ messages in thread
From: Daniel Berlin @ 2003-04-28  5:22 UTC (permalink / raw)
  To: Wei Liu; +Cc: gcc


On Sunday, April 27, 2003, at 10:59  PM, Wei Liu wrote:

> I have a very simple kernel as follows. The problem is, for statement
> a=b+c, there is no USE or VUSE I can get from get_ops and get_vops.
At what point?
IE Where is your code inserted that you are seeing this.

> So
> this statement seems to me no use operands. It is really weird, 
> because I
> suppose I can all operands from get_ops and get_vops.
>
> Any suggestions are greatly appreciated. Thanks.
>
> ---------------------------------------------
> void foo1 (const char *);
> int foo2(float *in, float *in2);
> float a;
>
>
> int func(int *in, int in2)
> {
>   float b, c;
>   int i;
>
>   for (i = 0; i < 10; i++)
>     {
>       foo1("yes");
>       foo2 (&b, &c);
>
>       *in = in2;
>       a = b + c;
>     }
> }
>
>
> =============================
> Sincerely,
> Wei Liu
>
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [tree-ssa] USE or VUSE bugs?
  2003-04-28  5:22 ` Daniel Berlin
@ 2003-04-28  5:35   ` Wei Liu
  2003-04-28  7:07     ` Daniel Berlin
  0 siblings, 1 reply; 14+ messages in thread
From: Wei Liu @ 2003-04-28  5:35 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: gcc


On Sun, 27 Apr 2003, Daniel Berlin wrote:

>
> On Sunday, April 27, 2003, at 10:59  PM, Wei Liu wrote:
>
> > I have a very simple kernel as follows. The problem is, for statement
> > a=b+c, there is no USE or VUSE I can get from get_ops and get_vops.
> At what point?
> IE Where is your code inserted that you are seeing this.
>

My code is inserted in tree-optimize.c and just after tree_ssa_dce pass. I
hope I can operands b and c, but what I got is only .GLOBAL_VAR_20.

> > So
> > this statement seems to me no use operands. It is really weird,
> > because I
> > suppose I can all operands from get_ops and get_vops.
> >
> > Any suggestions are greatly appreciated. Thanks.
> >
> > ---------------------------------------------
> > void foo1 (const char *);
> > int foo2(float *in, float *in2);
> > float a;
> >
> >
> > int func(int *in, int in2)
> > {
> >   float b, c;
> >   int i;
> >
> >   for (i = 0; i < 10; i++)
> >     {
> >       foo1("yes");
> >       foo2 (&b, &c);
> >
> >       *in = in2;
> >       a = b + c;
> >     }
> > }
> >
> >


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [tree-ssa] USE or VUSE bugs?
  2003-04-28  4:49 [tree-ssa] USE or VUSE bugs? Wei Liu
  2003-04-28  5:22 ` Daniel Berlin
@ 2003-04-28  5:57 ` Diego Novillo
  2003-04-28  6:16   ` Wei Liu
  1 sibling, 1 reply; 14+ messages in thread
From: Diego Novillo @ 2003-04-28  5:57 UTC (permalink / raw)
  To: Wei Liu; +Cc: gcc

On Sun, Apr 27, 2003 at 09:59:39PM -0500, Wei Liu wrote:

> Any suggestions are greatly appreciated. Thanks.
> 
Compile with -fdump-tree-all-vops-alias and check the .c.t09.ssa
file.  'b' and 'c' are aliased by 'b.4' and '*T.3' (yes, our
aliasing code is rather lame).


Diego.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [tree-ssa] USE or VUSE bugs?
  2003-04-28  5:57 ` Diego Novillo
@ 2003-04-28  6:16   ` Wei Liu
  2003-04-28  8:06     ` Daniel Berlin
  0 siblings, 1 reply; 14+ messages in thread
From: Wei Liu @ 2003-04-28  6:16 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc

Thank you for Diego and Daniel's help.

Eventually I figured out when I compile it with option
-fno-strict-aliasing and -ftree-points-to=anderson together, it will have
the problem. So after remove -fno-strict-aliasing, everything looks fine
to me.

I'm still not sure why using these two flags together may cause problems.
If these two can not be used together, it would be nice if the compile can
throw out a warning or error info.

thanks.

Wei

On Sun, 27 Apr 2003, Diego Novillo wrote:

> On Sun, Apr 27, 2003 at 09:59:39PM -0500, Wei Liu wrote:
>
> > Any suggestions are greatly appreciated. Thanks.
> >
> Compile with -fdump-tree-all-vops-alias and check the .c.t09.ssa
> file.  'b' and 'c' are aliased by 'b.4' and '*T.3' (yes, our
> aliasing code is rather lame).
>
>
> Diego.
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [tree-ssa] USE or VUSE bugs?
  2003-04-28  5:35   ` Wei Liu
@ 2003-04-28  7:07     ` Daniel Berlin
  0 siblings, 0 replies; 14+ messages in thread
From: Daniel Berlin @ 2003-04-28  7:07 UTC (permalink / raw)
  To: Wei Liu; +Cc: gcc


On Sunday, April 27, 2003, at 11:41  PM, Wei Liu wrote:

>
> On Sun, 27 Apr 2003, Daniel Berlin wrote:
>
>>
>> On Sunday, April 27, 2003, at 10:59  PM, Wei Liu wrote:
>>
>>> I have a very simple kernel as follows. The problem is, for statement
>>> a=b+c, there is no USE or VUSE I can get from get_ops and get_vops.
>> At what point?
>> IE Where is your code inserted that you are seeing this.
>>
>
> My code is inserted in tree-optimize.c and just after tree_ssa_dce 
> pass. I
> hope I can operands b and c, but what I got is only .GLOBAL_VAR_20.
Sorry, should have looked closer at your code.
This is because b and c are call clobbered, so they aren't renamed.
Thus, the SSA optimizers aren't supposed to touch them (since they 
aren't in SSA form), and to make this so, they don't appear in the 
use_ops.
a is a global, so it isn't renamed either.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [tree-ssa] USE or VUSE bugs?
  2003-04-28  6:16   ` Wei Liu
@ 2003-04-28  8:06     ` Daniel Berlin
  2003-04-28 18:20       ` Still has problems: " Wei Liu
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Berlin @ 2003-04-28  8:06 UTC (permalink / raw)
  To: Wei Liu; +Cc: Diego Novillo, gcc


On Monday, April 28, 2003, at 12:45  AM, Wei Liu wrote:

> Thank you for Diego and Daniel's help.
>
> Eventually I figured out when I compile it with option
> -fno-strict-aliasing and -ftree-points-to=anderson together,
> it will have
> the problem. So after remove -fno-strict-aliasing, everything looks 
> fine
> to me.
-fno-strict-aliasing seems to badly screw the aliasing info.
Watch:
with -fno-strict-aliasing:
#   (*T.3)_13 = VDEF <(*T.3)_10
#   .GLOBAL_VAR_14 = VDEF <.GLOBAL_VAR_11>;
b.4_12 = &b;

#   (*T.3)_16 = VDEF <(*T.3)_13>;
#   .GLOBAL_VAR_17 = VDEF <.GLOBAL_VAR_14>;
c.5_15 = &c;
#   (*T.3)_18 = VDEF <(*T.3)_16>;
#   .GLOBAL_VAR_19 = VDEF <.GLOBAL_VAR_17>;
foo2 (b.4_12, c.5_15);


without it:
#   (*T.3)_19 = VDEF <(*T.3)_14>;
#   (*b.4)_20 = VDEF <(*b.4)_15>;
#   .GLOBAL_VAR_21 = VDEF <.GLOBAL_VAR_17>;
b.4_18 = &b;
#   (*T.3)_23 = VDEF <(*T.3)_19>;
#   (*b.4)_24 = VDEF <(*b.4)_20>;
#   .GLOBAL_VAR_25 = VDEF <.GLOBAL_VAR_21>;
c.5_22 = &c;
#   (*T.3)_26 = VDEF <(*T.3)_23>;
#   (*b.4)_27 = VDEF <(*b.4)_24>;
#   .GLOBAL_VAR_28 = VDEF <.GLOBAL_VAR_25>;
foo2 (b.4_18, c.5_22);


The second is clearly correct, the first, while it looks better (which 
is funny, of course, since strict aliasing should give better results), 
is wrong.

-fno-strict-aliasing also misses a few clobbered variables in an 
earlier call:

-fno-strict-aliasing:
111         #   .GLOBAL_VAR_11 = VDEF <.GLOBAL_VAR_3>;
     112         #   VUSE <(*T.3)_10>;
     113         foo1 (T.3_9);
strict aliasing:
#   .GLOBAL_VAR_17 = VDEF <.GLOBAL_VAR_3>;
     116         #   VUSE <(*T.3)_14>;
     117         #   VUSE <(*b.4)_15>;
     118         #   VUSE <(*in)_16>;
     119         foo1 (T.3_13);


This all is the exact opposite of what one expects in terms of 
"quality" of aliasing (which is why i started to assume something is 
broken).

This is all without using tree PTA at all
Besides that, i'll note if you had the source to foo2 (or whatever the 
function was named that you were passing &b and &c to) and made it 
static, you can use -ftree-points-to=andersen and -funit-at-a-time, and 
it should be able to figure out what's going on (-funit-at-a-time 
enables interprocedural points-to analysis for static functions).

I just noticed a bug in querying PTA before we've created the alias 
variables, i'll fix it (it's just moving the code a few lines up in 
tree-dfa.) after my final tomorrow.

>
> I'm still not sure why using these two flags together may cause 
> problems.
> If these two can not be used together, it would be nice if the compile 
> can
> throw out a warning or error info.
>
I think -fno-strict-aliasing is currently very borked, unless i've 
missed something.

> thanks.
>
> Wei
>
> On Sun, 27 Apr 2003, Diego Novillo wrote:
>
>> On Sun, Apr 27, 2003 at 09:59:39PM -0500, Wei Liu wrote:
>>
>>> Any suggestions are greatly appreciated. Thanks.
>>>
>> Compile with -fdump-tree-all-vops-alias and check the .c.t09.ssa
>> file.  'b' and 'c' are aliased by 'b.4' and '*T.3' (yes, our
>> aliasing code is rather lame).
>>
>>
>> Diego.
>>
>
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Still has problems: Re: [tree-ssa] USE or VUSE bugs?
  2003-04-28  8:06     ` Daniel Berlin
@ 2003-04-28 18:20       ` Wei Liu
  2003-04-29  2:09         ` Daniel Berlin
  2003-04-29  7:25         ` Diego Novillo
  0 siblings, 2 replies; 14+ messages in thread
From: Wei Liu @ 2003-04-28 18:20 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: Diego Novillo, gcc


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Still has problems: Re: [tree-ssa] USE or VUSE bugs?
  2003-04-28 18:20       ` Still has problems: " Wei Liu
@ 2003-04-29  2:09         ` Daniel Berlin
  2003-04-29  3:48           ` Richard Henderson
  2003-04-29  7:25         ` Diego Novillo
  1 sibling, 1 reply; 14+ messages in thread
From: Daniel Berlin @ 2003-04-29  2:09 UTC (permalink / raw)
  To: Wei Liu; +Cc: Diego Novillo, gcc


On Monday, April 28, 2003, at 12:02  PM, Wei Liu wrote:

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

a can't alias with *str.6, that would imply str.6 = &a, and that's not 
allowed due to strict aliasing.


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Still has problems: Re: [tree-ssa] USE or VUSE bugs?
  2003-04-29  2:09         ` Daniel Berlin
@ 2003-04-29  3:48           ` Richard Henderson
  2003-04-29 10:50             ` Daniel Berlin
  0 siblings, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2003-04-29  3:48 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: Wei Liu, Diego Novillo, gcc

On Mon, Apr 28, 2003 at 06:33:23PM -0400, Daniel Berlin wrote:
> >  char *str;
> 
> a can't alias with *str.6, that would imply str.6 = &a, and that's not 
> allowed due to strict aliasing.

Why not?  "char" and company are allowed to alias anything.


r~

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Still has problems: Re: [tree-ssa] USE or VUSE bugs?
  2003-04-28 18:20       ` Still has problems: " Wei Liu
  2003-04-29  2:09         ` Daniel Berlin
@ 2003-04-29  7:25         ` Diego Novillo
  2003-04-29  7:54           ` Wei Liu
  1 sibling, 1 reply; 14+ messages in thread
From: Diego Novillo @ 2003-04-29  7:25 UTC (permalink / raw)
  To: Wei Liu; +Cc: Daniel Berlin, gcc

On Mon, Apr 28, 2003 at 11:02:06AM -0500, Wei Liu wrote:

>   #   (*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?
> 
Add -alias to your -fdump... flag.  You should find 'a' aliased to
*str.1, *b.5 and .GLOBAL_VAR.


Diego.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Still has problems: Re: [tree-ssa] USE or VUSE bugs?
  2003-04-29  7:25         ` Diego Novillo
@ 2003-04-29  7:54           ` Wei Liu
  2003-04-29 10:58             ` Diego Novillo
  0 siblings, 1 reply; 14+ messages in thread
From: Wei Liu @ 2003-04-29  7:54 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Daniel Berlin, gcc

On Mon, 28 Apr 2003, Diego Novillo wrote:

> On Mon, Apr 28, 2003 at 11:02:06AM -0500, Wei Liu wrote:
>
> >   #   (*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?
> >
> Add -alias to your -fdump... flag.  You should find 'a' aliased to
> *str.1, *b.5 and .GLOBAL_VAR.
Yes. I do fine the alias info. Maybe I can simplify my question as: how
can I get the use operands for the statement "a=c"?

>
>
> Diego.
>

=============================
Sincerely,
Wei Liu

Postdoctoral Research Associate
2251 DCL, Department of Computer Science
University of Illinois at Urbana-Champaign
1304 W. Springfield Ave.
Urbana, IL 61801
Phone: (217)244-7207(O)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Still has problems: Re: [tree-ssa] USE or VUSE bugs?
  2003-04-29  3:48           ` Richard Henderson
@ 2003-04-29 10:50             ` Daniel Berlin
  0 siblings, 0 replies; 14+ messages in thread
From: Daniel Berlin @ 2003-04-29 10:50 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Wei Liu, Diego Novillo, gcc


On Monday, April 28, 2003, at 08:52  PM, Richard Henderson wrote:

> On Mon, Apr 28, 2003 at 06:33:23PM -0400, Daniel Berlin wrote:
>>>  char *str;
>>
>> a can't alias with *str.6, that would imply str.6 = &a, and that's not
>> allowed due to strict aliasing.
>
> Why not?  "char" and company are allowed to alias anything.


Yeah, i forgot about that for a moment (just had come home from a 
final, brain filled with corporations).
But i'm not going to think more about his question, because my only 
concern is generally whether PTA has screwed something up.

PTA gives the right answers here AFAICT, so if something is wrong, it's 
elsewhere (and thus, out of my jurisdiction):
Points-to sets:
T.7 :={}(0)
T.8 :={}(0)
T.9 :={c,b,.GLOBAL_VAR}(3)
b.10 :={c,b,.GLOBAL_VAR}(3)
c.11 :={c,b,.GLOBAL_VAR}(3)
c :={.GLOBAL_VAR}(1)
in :={.GLOBAL_VAR}(1)
.GLOBAL_VAR :={.GLOBAL_VAR}(1)
in2 :={}(0)
func :={func}(1)
str.1 :={.GLOBAL_VAR,b}(2)
str :={}(0)
T.2 :={}(0)
T.3 :={}(0)
T.4 :={.GLOBAL_VAR,b}(2)
b.5 :={.GLOBAL_VAR,b}(2)
b :={.GLOBAL_VAR}(1)
sscanf :={sscanf}(1)
str.6 :={c,b,.GLOBAL_VAR}(3)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Still has problems: Re: [tree-ssa] USE or VUSE bugs?
  2003-04-29  7:54           ` Wei Liu
@ 2003-04-29 10:58             ` Diego Novillo
  0 siblings, 0 replies; 14+ messages in thread
From: Diego Novillo @ 2003-04-29 10:58 UTC (permalink / raw)
  To: Wei Liu; +Cc: Daniel Berlin, gcc

On Mon, 2003-04-28 at 22:24, Wei Liu wrote:
> On Mon, 28 Apr 2003, Diego Novillo wrote:
> 
> > On Mon, Apr 28, 2003 at 11:02:06AM -0500, Wei Liu wrote:
> >
> > >   #   (*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?
> > >
> > Add -alias to your -fdump... flag.  You should find 'a' aliased to
> > *str.1, *b.5 and .GLOBAL_VAR.
> Yes. I do fine the alias info. Maybe I can simplify my question as: how
> can I get the use operands for the statement "a=c"?
> 
Currently you can't.  'a' is a global and 'c' is aliased.  You either
need to fine tune the alias analyzer and/or follow the virtual operands.

The operands for that statement are telling you that the assignment may
modify *str.1, *b.5 and .GLOBAL_VAR.  As I said yesterday, our alias
analysis routines need a lot of help.  They're way too conservative at
the moment.


Diego.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2003-04-29  2:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-28  4:49 [tree-ssa] USE or VUSE bugs? Wei Liu
2003-04-28  5:22 ` Daniel Berlin
2003-04-28  5:35   ` Wei Liu
2003-04-28  7:07     ` Daniel Berlin
2003-04-28  5:57 ` Diego Novillo
2003-04-28  6:16   ` Wei Liu
2003-04-28  8:06     ` Daniel Berlin
2003-04-28 18:20       ` Still has problems: " Wei Liu
2003-04-29  2:09         ` Daniel Berlin
2003-04-29  3:48           ` Richard Henderson
2003-04-29 10:50             ` Daniel Berlin
2003-04-29  7:25         ` Diego Novillo
2003-04-29  7:54           ` Wei Liu
2003-04-29 10:58             ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).