Bug 45458 - [4.5/4.6 Regression] ICE: in add_labels_and_missing_jumps, at bb-reorder.c:1306 with-fnon-call-exceptions -freorder-blocks-and-partition -fprofile-use
Summary: [4.5/4.6 Regression] ICE: in add_labels_and_missing_jumps, at bb-reorder.c:13...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.5.2
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-30 21:34 UTC by Zdenek Sojka
Modified: 2010-09-02 08:01 UTC (History)
1 user (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work: 4.4.5
Known to fail: 4.5.0 4.6.0
Last reconfirmed: 2010-09-01 16:35:01


Attachments
reduced testcase (from g++.dg/tree-prof/partition1.C) (60 bytes, text/plain)
2010-08-30 21:36 UTC, Zdenek Sojka
Details
gcc46-pr45458.patch (1.06 KB, patch)
2010-09-01 17:12 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2010-08-30 21:34:41 UTC
Command line:
$ g++ testcase.C -fnon-call-exceptions -freorder-blocks-and-partition -fprofile-generate
$ rm *.gcda
$ ./a.out
$ g++ testcase.C -fnon-call-exceptions -freorder-blocks-and-partition -fprofile-use

Compiler output:
$ g++ testcase.C -fnon-call-exceptions -freorder-blocks-and-partition -fprofile-use
testcase.C: In function 'int main()':
testcase.C:10:1: internal compiler error: in add_labels_and_missing_jumps, at bb-reorder.c:1306
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.

With -O1, gcc crashes with the original testcase:
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/tree-prof/partition1.C: In function 'int bar(int)':
/mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/tree-prof/partition1.C:19:1: internal compiler error: in convert_to_eh_region_ranges, at except.c:2446
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Older versions warned with:
cc1plus: note: -freorder-blocks-and-partition does not work with exceptions

Tested revisions:
r163636 - crash
r158095 - crash
r153685 - crash
4.4 r154975 - warns
4.4 r160770 - warns
Comment 1 Zdenek Sojka 2010-08-30 21:36:57 UTC
Created attachment 21597 [details]
reduced testcase (from g++.dg/tree-prof/partition1.C)

CC=g++
$CC pr45458.C -fnon-call-exceptions -freorder-blocks-and-partition -fprofile-generate ; rm *.gcda ; ./a.out ; $CC pr45458.C -fnon-call-exceptions -freorder-blocks-and-partition -fprofile-use
Comment 2 Jakub Jelinek 2010-09-01 17:12:07 UTC
Created attachment 21648 [details]
gcc46-pr45458.patch

Untested fix.
Comment 3 Jakub Jelinek 2010-09-01 19:46:39 UTC
Subject: Bug 45458

Author: jakub
Date: Wed Sep  1 19:46:21 2010
New Revision: 163743

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163743
Log:
	PR middle-end/45458
	* bb-reorder.c (add_labels_and_missing_jumps): Treat
	bbs ending with throwing insns like blocks ending with a call.
	(fix_up_fall_thru_edges): Likewise.

	* g++.dg/tree-prof/partition2.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/tree-prof/partition2.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/bb-reorder.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Jakub Jelinek 2010-09-02 07:57:01 UTC
Subject: Bug 45458

Author: jakub
Date: Thu Sep  2 07:56:48 2010
New Revision: 163761

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163761
Log:
	PR middle-end/45458
	* bb-reorder.c (add_labels_and_missing_jumps): Treat
	bbs ending with throwing insns like blocks ending with a call.
	(fix_up_fall_thru_edges): Likewise.

	* g++.dg/tree-prof/partition2.C: New test.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/tree-prof/partition2.C
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/bb-reorder.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog

Comment 5 Jakub Jelinek 2010-09-02 08:01:39 UTC
Fixed.