From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21152 invoked by alias); 4 Apr 2011 03:53:01 -0000 Received: (qmail 21141 invoked by uid 22791); 4 Apr 2011 03:53:00 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_XG X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Apr 2011 03:52:55 +0000 From: "williambader at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/48431] New: patch to fix a compile error in lto-plugin.c when using older C compilers X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: williambader at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 04 Apr 2011 03:53:00 -0000 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: 2011-04/txt/msg00251.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48431 Summary: patch to fix a compile error in lto-plugin.c when using older C compilers Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto AssignedTo: unassigned@gcc.gnu.org ReportedBy: williambader@hotmail.com Created attachment 23867 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23867 patch to fix the problem The build for gcc-4.6.0 gets a compile error on lto-plugin.c on Red Hat Linux release 7.1 (Seawolf) with gcc version 2.96 20000731 because this compiler does not allow declarations after the first statement. The attached patch moves a declaration a few lines back. For the build, I ran /u/gnu/gcc-4.6.0/configure --disable-nls --enable-checking=release --enable-werror=no --with-system-zlib --disable-multilib --with-gmp=/usr/local --with-mpfr=/usr/local make CC=gcc 'CFLAGS=-O0 -g -pipe' 'LIBCFLAGS=-O0 ' 'LIBCXXFLAGS=-O0 -fno-implicit-templates ' 'CXXFLAGS=-O0 -fno-implicit-templates ' 'CXXFLAGS_FOR_BUILD=-O0 -fno-implicit-templates ' 'CXXFLAGS_FOR_TARGET=-O0 -fno-implicit-templates ' 'GOCFLAGS_FOR_TARGET=-O0 -g -pipe' 'BOOT_CFLAGS= -O0 -g -pipe' AS=/usr/bin/as bootstrap-lean Without all of the -O0's, the stage2 xgcc gets an ICE almost immediately on almost any input.