The following gives a segmentation fault with N > 65535. This is taken from PR19925 Comment #10. I have the fix for the segfault. INTEGER, PARAMETER :: N=100000 INTEGER, PARAMETER :: I(N)=(/(MOD(K,2),K=1,N)/) INTEGER, PARAMETER :: M(N)=I(N:1:-1) END
Created attachment 15080 [details] Proposed patch to fix some segfaults This patch avoids the seg fault for the test case in this PR as well as the invalid code given in PR34828 Comment #10. I will submit this when 4.4 opens.
Just confirming this.
Subject: Bug 35059 Author: jvdelisle Date: Fri Feb 29 22:50:25 2008 New Revision: 132782 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132782 Log: 2008-02-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35059 * expr.c (find_array_element): Modify traversing the constructor to avoid trying to access NULL memory pointed to by next for the last element. (find_array_section): Exit while loop if cons->next is NULL. * trans-expr.c (gfc_conv_scalar_char_value): Initialize gfc_typespec. (gfc_conv_function_call): Same. * decl.c (gfc_match_implicit): Same. * trans-intrinsic.c (gfc_conv_intrinsic_sr_kind): Same. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c trunk/gcc/fortran/expr.c trunk/gcc/fortran/trans-expr.c trunk/gcc/fortran/trans-intrinsic.c
Fixed on 4.4