From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15671 invoked by alias); 5 Feb 2010 23:11:15 -0000 Received: (qmail 15639 invoked by uid 48); 5 Feb 2010 23:11:02 -0000 Date: Fri, 05 Feb 2010 23:11:00 -0000 Message-ID: <20100205231102.15638.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/30153] -fPIC failure In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "reza dot yazdani at amd dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00436.txt.bz2 ------- Comment #4 from reza dot yazdani at amd dot com 2010-02-05 23:11 ------- (In reply to comment #3) > "The optimization performed is correct because: > > In C++ (not in C) a const modifier in a global variable has internal > linkage (i.e. it is treated like a static variable) and therefore the > optimization performed is correct. A global const variable can have > legally different values in different files. > > In C, it is illegal to initialize a global variable in more than one > location, and if initialized in more than one place all values must be > the same, because its initial value is nondeterministic if different. > > This bug is unrelated to PIC, it will behave the same, if the program is > written according to the C/C++ standards." > > I suggest to be closed and marked as user error. > Sorry, ignore the above comment. I wanted to add the above comment to the bug 35501. It was the first time I was doing this and somehow, it got added to this bug. Please ignore it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30153