This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/36369] [4.3/4.4 Regression] may_alias broken with previous uses of non attributed type in some cases
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 May 2008 14:00:38 -0000
- Subject: [Bug middle-end/36369] [4.3/4.4 Regression] may_alias broken with previous uses of non attributed type in some cases
- References: <bug-36369-87@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from jakub at gcc dot gnu dot org 2008-05-29 14:00 -------
Yeah, or:
void *a;
int
f0 (long *y)
{
*y = *(const long *) &a;
return 1;
}
int
f1 (long *y)
{
typedef long __attribute__ ((may_alias)) long_a;
*y = *(const long_a *) &a;
return 1;
}
int
f2 (long *y)
{
*y = *(const long *) &a;
return 1;
}
which IMHO should warn in f0 and f2 and not in f1. Stock trunk warns in all 3
cases, with my hack surprisingly it warns only in f0.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36369