Bug 35059 - Seg fault when max constructor limit reached
Summary: Seg fault when max constructor limit reached
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Jerry DeLisle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-02 17:27 UTC by Jerry DeLisle
Modified: 2008-03-12 01:11 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-02-03 16:32:52


Attachments
Proposed patch to fix some segfaults (411 bytes, patch)
2008-02-02 17:36 UTC, Jerry DeLisle
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jerry DeLisle 2008-02-02 17:27:41 UTC
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
Comment 1 Jerry DeLisle 2008-02-02 17:36:42 UTC
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.
Comment 2 Jerry DeLisle 2008-02-03 16:32:52 UTC
Just confirming this.
Comment 3 Jerry DeLisle 2008-02-29 22:51:14 UTC
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

Comment 4 Jerry DeLisle 2008-03-12 01:11:09 UTC
Fixed on 4.4