This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/18842] Weak optimization on global references
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Dec 2004 15:14:15 -0000
- Subject: [Bug tree-optimization/18842] Weak optimization on global references
- References: <20041205085537.18842.felix.nawothnig@t-online.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-05 15:14 -------
Consider these two TUs:
extern int *y, x, z;
int foo();
extern "C" void abort();
int main()
{
foo();
if (*y!=42)
abort();
if (y!=&x)
abort();
y = &z;
foo ();
if (*y!=42)
abort();
if (y!=&z)
abort();
return 0;
}
-----
int x, &y = x, z;
int foo() { y = 42; }
-----
Now I think the above is invalid C++ but we don't have to diagnostic since the standard allows us not
to but since the standard allows the correct way, we can optimizate global references now.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c++ |tree-optimization
Ever Confirmed| |1
Keywords| |missed-optimization
Last reconfirmed|0000-00-00 00:00:00 |2004-12-05 15:14:15
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18842