[Bug rtl-optimization/25654] [4.0/4.1/4.2 Regression] RTL alias analysis unprepared to handle stack slot sharing

steven at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Jan 14 00:11:00 GMT 2006



------- Comment #5 from steven at gcc dot gnu dot org  2006-01-14 00:10 -------
Hmm, not sure...  Consider this modified test case:

nion setconflict
{
  short a[20];
  int b[10];
};

int
foo (void)
{
  int sum = 0;
  {
    struct A { union setconflict u; } a;
    short *c;
    c = a.u.a;
    asm ("": "=r" (c):"0" (c));
    *c = 2;
    asm ("": "=r" (c):"0" (c));
    sum += *c;
  }
  {
    struct B { union setconflict u; } a;
    int *c;
    c = a.u.b;
    asm ("": "=r" (c):"0" (c));
    *c = 1;
    asm ("": "=r" (c):"0" (c));
    sum += *c;
  }

  return sum;
}


The two objects called a are put into different partitions because
objects_must_conflict_p (type_i, type_j) now says the types A and B don't have
to conflict, and we get:

;; Function foo (foo)

Partition 0: size 40 align 4
        a, offset 0
Partition 1: size 40 align 4
        a, offset 0

This happens because the alias sets for A and B are different.


-- 


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



More information about the Gcc-bugs mailing list