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: "hubicka at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jan 2006 14:56:54 -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 #7 from hubicka at gcc dot gnu dot org 2006-01-16 14:56 -------
These two testcases seems to still fail for me even with the patch. (I use b.c
-mpreferred-stack-boundary=2 -S -march=i686 -frename-registers)
extern void abort (void) __attribute__((noreturn));
struct setconflict
{
char a[36];
int b;
};
int
main ()
{
int sum = 0;
{
struct setconflict a;
short *c;
c = (void *)a.a;
asm ("": "=r" (c):"0" (c));
*c = 0;
asm ("": "=r" (c):"0" (c));
sum += *c;
}
{
struct setconflict a;
int *c;
c = (void *)a.a;
asm ("": "=r" (c):"0" (c));
*c = 1;
asm ("": "=r" (c):"0" (c));
sum += *c;
}
printf ("%d\n",sum);
if (sum != 1)
abort();
return 0;
}
extern void abort (void) __attribute__((noreturn));
struct wrapper {
union setconflict
{
short a[20];
int b[10];
} a;
};
int
main ()
{
int sum = 0;
{
struct wrapper a;
short *c;
c = a.a.a;
asm ("": "=r" (c):"0" (c));
*c = 0;
asm ("": "=r" (c):"0" (c));
sum += *c;
}
{
struct wrapper a;
int *c;
c = a.a.b;
asm ("": "=r" (c):"0" (c));
*c = 1;
asm ("": "=r" (c):"0" (c));
sum += *c;
}
printf ("%d\n",sum);
if (sum != 1)
abort();
return 0;
}
So looking for unions is IMO not strong enought test. Not sure what proper
solution shall be :(
Honza
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25654