This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/45967] [4.5/4.6 Regression] gcc-4.5.x optimizes code with side-effects away
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 13 Oct 2010 11:55:15 +0000
- Subject: [Bug rtl-optimization/45967] [4.5/4.6 Regression] gcc-4.5.x optimizes code with side-effects away
- Auto-submitted: auto-generated
- References: <bug-45967-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45967
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-10-13 11:54:58 UTC ---
Testcase:
extern void abort (void);
void __attribute__((noinline,noclone))
foo (void *p_)
{
int *p;
int i;
for (i = 0; i < sizeof(int *); ++i)
((char *)&p)[i] = ((char *)p_)[i];
*p = 1;
}
int main()
{
int i = 0;
int *p = &i;
foo (&p);
if (i != 1)
abort ();
return 0;
}