This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR45172
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rth at redhat dot com
- Date: Mon, 15 Nov 2010 16:54:29 +0100 (CET)
- Subject: [PATCH] Fix PR45172
This tries to avoid the situation of creating a duplicate (one EH and
one fallthru) edge during EH unsplitting.
Bootstrapped and tested on x86_64-unknown-linux-gnu, ok for trunk?
Thanks,
Richard.
2010-11-15 Richard Guenther <rguenther@suse.de>
PR middle-end/45172
* tree-eh.c (cleanup_empty_eh_unsplit): Avoid creating duplicate
edges.
* gfortran.dg/gomp/pr45172.f90: New testcase.
Index: gcc/tree-eh.c
===================================================================
*** gcc/tree-eh.c (revision 166754)
--- gcc/tree-eh.c (working copy)
*************** cleanup_empty_eh_unsplit (basic_block bb
*** 3670,3675 ****
--- 3670,3677 ----
{
gimple_stmt_iterator gsi;
tree lab;
+ edge_iterator ei, ei2;
+ edge e, e2;
/* We really ought not have totally lost everything following
a landing pad label. Given that BB is empty, there had better
*************** cleanup_empty_eh_unsplit (basic_block bb
*** 3692,3697 ****
--- 3694,3718 ----
return false;
}
+ /* The destination block must not be a regular successor for any
+ of the preds of the landing pad. Thus, avoid turning
+ <..>
+ | \ EH
+ | <..>
+ | /
+ <..>
+ into
+ <..>
+ | | EH
+ <..>
+ which CFG verification would choke on. See PR45172. */
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ {
+ FOR_EACH_EDGE (e2, ei2, e->src->succs)
+ if (e2->dest == e_out->dest)
+ return false;
+ }
+
/* Attempt to move the PHIs into the successor block. */
if (cleanup_empty_eh_merge_phis (e_out->dest, bb, e_out, false))
{
Index: gcc/testsuite/gfortran.dg/gomp/pr45172.f90
===================================================================
*** gcc/testsuite/gfortran.dg/gomp/pr45172.f90 (revision 0)
--- gcc/testsuite/gfortran.dg/gomp/pr45172.f90 (revision 0)
***************
*** 0 ****
--- 1,21 ----
+ ! { dg-do compile }
+ ! { dg-options "-O -fopenmp -fexceptions" }
+
+ SUBROUTINE dbcsr_mult_m_e_e ( )
+ LOGICAL, PARAMETER :: use_combined_types = .FALSE.
+ INTEGER, ALLOCATABLE, DIMENSION(:, :) :: right_index_sr
+ INTEGER, ALLOCATABLE, DIMENSION(:, :, :) :: my_sizes
+ INTEGER, ALLOCATABLE, DIMENSION(:, :, :, :) :: all_sizes
+ ALLOCATE (all_sizes(4, LBOUND(my_sizes,2):UBOUND(my_sizes,2), &
+ LBOUND(my_sizes,3):UBOUND(my_sizes,3), 0:numnodes-1))
+ IF (use_combined_types) THEN
+ CALL mp_waitall (right_index_sr)
+ ENDIF
+ DO ki = 0, min_nimages-1
+ !$omp parallel default (none) &
+ !$omp reduction (+: flop_single, t_all, t_dgemm)
+ !$omp end parallel
+ ENDDO
+ checksum = dbcsr_checksum (product_matrix, error)
+ END SUBROUTINE dbcsr_mult_m_e_e
+