[Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Feb 22 15:57:00 GMT 2006


The function in question should ignore ADDR_EXPRs that appear inside CALL_EXPR
parameter lists so that we, for

typedef struct {
  int i;
  int j;
  int k;
} Foo;

void bar(Foo*);
void foo(void)
{
  Foo a;
  a.i = 1;
  bar(&a);
}

do not create SFTs for all elements of a, but only for the first.  This
will reduce clobbers at call sites from

<bb 2>:
  #   SFT.2_2 = V_MUST_DEF <SFT.2_1>;
  a.i = 1;
  #   SFT.0_5 = V_MAY_DEF <SFT.0_3>;
  #   SFT.1_6 = V_MAY_DEF <SFT.1_4>;
  #   SFT.2_7 = V_MAY_DEF <SFT.2_2>;
  bar (&a);

to

<bb 2>:
  #   SFT.2_2 = V_MUST_DEF <SFT.2_1>;
  a.i = 1;
  #   SFT.2_7 = V_MAY_DEF <SFT.2_2>;
  bar (&a);

it especially would reduce the amounts of SFTs we generate for gfortran
struct st_parm, which usually only gets a few fields written to and then
it's address is passed to a function.


-- 
           Summary: tree-ssa-alias.c:find_used_portions considers foo(&var)
                    use all elements of var
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: memory-hog, compile-time-hog, alias
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421



More information about the Gcc-bugs mailing list