re PR tree-optimization/48794 (ICE: SIGSEGV in remap_eh_region_nr (tree-inline.c:1194) with -Os -fopenmp -fexceptions -fno-tree-ccp -fno-tree-copy-prop)

PR tree-optimization/48794
	* tree-eh.c (remove_unreachable_handlers_no_lp): Don't remove
	regions referenced from RESX/EH_DISPATCH.

testsuite/
	* gfortran.dg/gomp/pr48794-2.f90: New testcase.

From-SVN: r183559
This commit is contained in:
Michael Matz 2012-01-26 13:24:58 +00:00
parent c0a9d2a12e
commit 1a47f99c0f
4 changed files with 55 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2012-01-26 Michael Matz <matz@suse.de>
PR tree-optimization/48794
* tree-eh.c (remove_unreachable_handlers_no_lp): Don't remove
regions referenced from RESX/EH_DISPATCH.
2012-01-26 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.h: Make BRANCH_COST an option.

View File

@ -1,7 +1,12 @@
2012-01-26 Michael Matz <matz@suse.de>
PR tree-optimization/48794
* gfortran.dg/gomp/pr48794-2.f90: New testcase.
2012-01-26 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gcc.dg/ssa-dom-thread-4.c: Set -mbranch-cost=2 for s390 and
s390x.
s390x.
2012-01-26 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>

View File

@ -0,0 +1,16 @@
! PR tree-optimization/48794
! { dg-do compile }
! { dg-options "-Os -fopenmp -fexceptions -fno-tree-ccp -fno-tree-copy-prop" }
integer, allocatable :: a(:)
integer :: b(48)
logical :: l
if (allocated (a)) then
call abort
call bla(b)
end if
!$omp parallel private (a) reduction (.or.:l)
do i = 1, 7
end do
!$omp end parallel
end

View File

@ -3617,14 +3617,40 @@ remove_unreachable_handlers_no_lp (void)
{
eh_region r;
int i;
sbitmap r_reachable;
basic_block bb;
r_reachable = sbitmap_alloc (VEC_length (eh_region, cfun->eh->region_array));
sbitmap_zero (r_reachable);
FOR_EACH_BB (bb)
{
gimple stmt = last_stmt (bb);
if (stmt)
/* Avoid removing regions referenced from RESX/EH_DISPATCH. */
switch (gimple_code (stmt))
{
case GIMPLE_RESX:
SET_BIT (r_reachable, gimple_resx_region (stmt));
break;
case GIMPLE_EH_DISPATCH:
SET_BIT (r_reachable, gimple_eh_dispatch_region (stmt));
break;
default:
break;
}
}
for (i = 1; VEC_iterate (eh_region, cfun->eh->region_array, i, r); ++i)
if (r && r->landing_pads == NULL && r->type != ERT_MUST_NOT_THROW)
if (r && r->landing_pads == NULL && r->type != ERT_MUST_NOT_THROW
&& !TEST_BIT (r_reachable, i))
{
if (dump_file)
fprintf (dump_file, "Removing unreachable region %d\n", i);
remove_eh_handler (r);
}
sbitmap_free (r_reachable);
}
/* Undo critical edge splitting on an EH landing pad. Earlier, we