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]

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



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.






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