------- Comment #18 from jvdelisle at gcc dot gnu dot org 2008-02-01 04:43 ------- With this patch:
@@ -1341,7 +1345,7 @@ find_array_section (gfc_expr *expr, gfc_ cons = base; } - while (mpz_cmp (ptr, index) > 0) + while (mpz_cmp (ptr, index) > 0 && cons && cons->next) { mpz_add_ui (index, index, one); cons = cons->next; The ICE for the second case on comment 10 goes away. However, compile time is very long as N increases: N = 1000, .113 secs 5000, .702 10000, 5.627 12000, 11.091 15000, 21.500 20000, 42.228 25000, 66.600 For N=100000 After several minutes we get the error message: pr19925-10.f90:9.36: INTEGER, PARAMETER :: M(N)=I(N:1:-1) 1 Error: Initialization expression didn't reduce (1) The ICE for this example is not related to the original problem in this PR. Using the case of N = 5000, the printed results fo the array I, and m agree with ifort and sun f95. I am going to break this out as a separate PR and submit this patch as a fix. The failure to reduce, I am guessing is a different problem. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19925