From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18017 invoked by alias); 20 Feb 2015 07:26:17 -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 Received: (qmail 17989 invoked by uid 48); 20 Feb 2015 07:26:13 -0000 From: "su at cs dot ucdavis.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/65130] New: ICE with LTO on valid code on x86_64-linux-gnu Date: Fri, 20 Feb 2015 07:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: su at cs dot ucdavis.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg02200.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65130 Bug ID: 65130 Summary: ICE with LTO on valid code on x86_64-linux-gnu Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu The following code causes an ICE when compiled with the current gcc trunk with LTO on x86_64-linux-gnu in both 32-bit and 64-bit modes. It is a regression from 4.9.x. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 5.0.0 20150219 (experimental) [trunk revision 220822] (GCC) $ $ gcc-4.9 -flto -O1 -c foo.c $ gcc-4.9 -flto -O2 -c main.c $ gcc-4.9 -flto -O1 foo.o main.o $ ./a.out $ $ gcc-trunk -flto -O1 -c foo.c $ gcc-trunk -flto -O2 -c main.c $ gcc-trunk -flto -O1 foo.o main.o gcc-trunk: internal compiler error: Segmentation fault (program lto1) Please submit a full bug report, with preprocessed source if appropriate. See for instructions. lto-wrapper: fatal error: gcc-trunk returned 4 exit status compilation terminated. /usr/bin/ld: lto-wrapper failed collect2: error: ld returned 1 exit status $ $ cat foo.c extern void fn3 (void); void fn2(void) { fn3(); } void fn1(void) { fn2(); } void fn4(void) { fn2(); } $ cat main.c extern void fn1(void); extern void fn4 (void); int a; void fn3(void) { for (; a;) fn4(); } int main() { fn1(); return 0; } $