From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25279 invoked by alias); 20 May 2003 01:16:38 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 25214 invoked by uid 48); 20 May 2003 01:16:38 -0000 Date: Tue, 20 May 2003 01:16:00 -0000 Message-ID: <20030520011638.25212.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, lloyd@acm.jhu.edu, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, lloyd@acm.jhu.edu, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: optimization/10877: [3.3/3.4 regression] miscompilation with -O3 -fPIC on x86 X-SW-Source: 2003-05/txt/msg02135.txt.bz2 List-Id: Old Synopsis: GCC 3.3 miscompiles code with -O3 -fPIC on x86 New Synopsis: [3.3/3.4 regression] miscompilation with -O3 -fPIC on x86 State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Tue May 20 01:16:37 2003 State-Changed-Why: Confirmed. This is a smaller snippet (it has nothing to do with namespaces): ---------------------------- int* i; int& get_x() { return *i; } int main() { int j; i = &j; get_x(); } -------------------------- It crashed in get_x: g/x> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -O3 -fPIC x.cc g/x> ./a.out Segmentation fault Note that we really need both -fPIC and -O3. This crashes with both 3.3 and present mainline. It doesn't with 2.95 and 3.2.3, so it's definitely a regression worth fixing! W. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10877