From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21107 invoked by alias); 5 Dec 2004 15:14:18 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 21089 invoked by uid 48); 5 Dec 2004 15:14:15 -0000 Date: Sun, 05 Dec 2004 15:14:00 -0000 Message-ID: <20041205151415.21088.qmail@sourceware.org> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041205085537.18842.felix.nawothnig@t-online.de> References: <20041205085537.18842.felix.nawothnig@t-online.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/18842] Weak optimization on global references X-Bugzilla-Reason: CC X-SW-Source: 2004-12/txt/msg00712.txt.bz2 List-Id: ------- 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