This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/25654] [4.0/4.1/4.2 Regression] RTL alias analysis unprepared to handle stack slot sharing
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jan 2006 00:10:58 -0000
- Subject: [Bug rtl-optimization/25654] [4.0/4.1/4.2 Regression] RTL alias analysis unprepared to handle stack slot sharing
- References: <bug-25654-280@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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