From 30a435d83ab076958e210c724f090d0c6a27781a Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Wed, 25 May 2011 02:15:58 +0000 Subject: [PATCH] re PR rtl-optimization/48757 (internal compiler error: in compensate_edge, at reg-stack.c:2788) 2011-05-24 Vladimir Makarov PR rtl-optimization/48757 * ira-build.c (loop_with_eh_edge_p): Rename to loop_with_complex_edge_p, check edges on complexity, make function conditional. (mark_loops_for_removal): Make call of loop_with_complex_edge_p conditional. 2011-05-24 Vladimir Makarov PR rtl-optimization/48757 * gfortran.dg/pr48757.f: New test case. From-SVN: r174165 --- gcc/ChangeLog | 9 +++++ gcc/ira-build.c | 15 +++++--- gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/gfortran.dg/pr48757.f | 54 +++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/pr48757.f diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cf8e4e75752..9bafa1de318 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2011-05-24 Vladimir Makarov + + PR rtl-optimization/48757 + * ira-build.c (loop_with_eh_edge_p): Rename to + loop_with_complex_edge_p, check edges on complexity, make function + conditional. + (mark_loops_for_removal): Make call of loop_with_complex_edge_p + conditional. + 2011-05-24 Eric Botcazou * config/sparc/sparc.c (sparc_option_override): If not set by the user, diff --git a/gcc/ira-build.c b/gcc/ira-build.c index 31d0199791a..95d6c169a27 100644 --- a/gcc/ira-build.c +++ b/gcc/ira-build.c @@ -1806,9 +1806,12 @@ low_pressure_loop_node_p (ira_loop_tree_node_t node) return true; } -/* Return TRUE if LOOP has a EH enter or exit edge. */ +#ifdef STACK_REGS +/* Return TRUE if LOOP has a complex enter or exit edge. We don't + form a region from such loop if the target use stack register + because reg-stack.c can not deal with such edges. */ static bool -loop_with_eh_edge_p (struct loop *loop) +loop_with_complex_edge_p (struct loop *loop) { int i; edge_iterator ei; @@ -1820,10 +1823,11 @@ loop_with_eh_edge_p (struct loop *loop) return true; edges = get_loop_exit_edges (loop); FOR_EACH_VEC_ELT (edge, edges, i, e) - if (e->flags & EDGE_EH) + if (e->flags & EDGE_COMPLEX) return true; return false; } +#endif /* Sort loops for marking them for removal. We put already marked loops first, then less frequent loops next, and then outer loops @@ -1884,7 +1888,10 @@ mark_loops_for_removal (void) ira_loop_nodes[i].to_remove_p = ((low_pressure_loop_node_p (ira_loop_nodes[i].parent) && low_pressure_loop_node_p (&ira_loop_nodes[i])) - || loop_with_eh_edge_p (ira_loop_nodes[i].loop)); +#ifdef STACK_REGS + || loop_with_complex_edge_p (ira_loop_nodes[i].loop) +#endif + ); } qsort (sorted_loops, n, sizeof (ira_loop_tree_node_t), loop_compare_func); for (i = 0; n - i + 1 > IRA_MAX_LOOPS_NUM; i++) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 14ef5becfa7..b39b4c726c6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-05-24 Vladimir Makarov + + PR rtl-optimization/48757 + * gfortran.dg/pr48757.f: New test case. + 2011-05-24 Jason Merrill * g++.dg/cpp0x/access01.C: New. diff --git a/gcc/testsuite/gfortran.dg/pr48757.f b/gcc/testsuite/gfortran.dg/pr48757.f new file mode 100644 index 00000000000..e89a59689e4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr48757.f @@ -0,0 +1,54 @@ +! { dg-do compile { target i?86-*-* x86_64-*-* } } +! { dg-options "-O2 -w" } +C fconc64.F, from CERNLIB (simplified) + + FUNCTION DFCONC(X,TAU,M) + IMPLICIT DOUBLE PRECISION (A-H,O-Z) + COMPLEX*16 WGAMMA,WLOGAM + COMPLEX*16 CGM,CLG,CRG,I,A,B,C,TI,R,RR,U(0:3),V(0:3),W(19) + LOGICAL LM0,LM1,LTA + CHARACTER NAME*(*) + CHARACTER*80 ERRTXT + PARAMETER (NAME = 'RFCONC/DFCONC') + DIMENSION T(7),H(9),S(5),P(11),D(-1:6) + PARAMETER (PI = 3.14159 26535 89793 24D+0) + PARAMETER (RPI = 1.77245 38509 05516 03D+0) + PARAMETER (I = (0,1)) + PARAMETER (Z1 = 1, HF = Z1/2, TH = 1+HF, C1 = Z1/10, C2 = Z1/5) + PARAMETER (RPH = 2/PI, RPW = 2/RPI, TW = 20, NMAX = 200) + DATA EPS /1D-14/ + ASSIGN 1 TO JP + GO TO 20 + 1 ASSIGN 2 TO JP + GO TO 20 + 2 IF(LM1) FC=2*FC/SQRT(1-X1) + GO TO 99 + 12 ASSIGN 3 TO JP + GO TO 20 + 3 IF(LM1) FC=SIGN(HF,1-X)*(TAU**2+HF**2)*SQRT(ABS(X**2-1))*FC + GO TO 99 + 13 ASSIGN 4 TO JP + GO TO 20 + 4 R1=EXP((TI-HF)*LOG(X+X)+CLG(1+TI)-CLG((TH-FM)+TI))* + 1 R*((HF-FM)+TI)/TI + FC=RPW*R1 + IF(LM1) FC=FC/SQRT(1-X1) + GO TO 99 + 20 IF(LTA) THEN + IF(ABS(R-RR) .LT. EPS) GO TO JP, (1,2,3,4) + ELSE + W(1)=X1*A*B/C + R=1+W(1) + DO 23 N = 1,NMAX + RR=R + W(1)=W(1)*X1*(A+FN)*(B+FN)/((C+FN)*(FN+1)) + IF(ABS(R-RR) .LT. EPS) GO TO JP, (1,2,3,4) + 23 CONTINUE + END IF + 99 DFCONC=FC + RETURN + 101 FORMAT('ILLEGAL ARGUMENT(S) X = ',D15.8,' TAU = ',D15.8, + 1 ' M = ',I3) + 102 FORMAT('CONVERGENCE PROBLEM FOR HYPERGEOMETRIC FUNCTION, X = ', + 1 D15.8) + END -- 2.30.2