Bug 18109 - ICE with explicit array of strings
Summary: ICE with explicit array of strings
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.1
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, monitored
Depends on:
Blocks: Fortran_character
  Show dependency treegraph
 
Reported: 2004-10-22 13:31 UTC by Martin Reinecke
Modified: 2005-06-05 22:42 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail: 4.0.0
Last reconfirmed: 2005-05-27 00:48:52


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Reinecke 2004-10-22 13:31:16 UTC
The current gfortran segfaults when compiling the following code

program test
  call foo ( (/"bar"/) )
end program

~/tmp>gfortran -v gfbug.f90 
Driving: gfortran -v gfbug.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc
Reading specs from /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.0.0/specs
Configured with: /scratch/gcc/configure --quiet
--prefix=/afs/mpa/data/martin/ugcc --enable-languages=c++,f95
--with-gmp=/afs/mpa/data/martin/mygmp
Thread model: posix
gcc version 4.0.0 20041021 (experimental)
 /afs/mpa/data/martin/ugcc/libexec/gcc/i686-pc-linux-gnu/4.0.0/f951 gfbug.f90
-quiet -dumpbase gfbug.f90 -mtune=pentiumpro -auxbase gfbug -version -o
/tmp/ccwl5Yg5.s
GNU F95 version 4.0.0 20041021 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.0 20041021 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
gfbug.f90: In function 'MAIN__':
gfbug.f90:2: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andrew Pinski 2004-10-22 13:42:46 UTC
Confirmed, I thought I saw something like this before.
Comment 2 Martin Reinecke 2004-10-22 13:45:50 UTC
Maybe you are thinking of
http://gcc.gnu.org/ml/fortran/2004-10/msg00172.html
But that wasn't a segfault.
Comment 3 GCC Commits 2005-02-14 23:24:59 UTC
Subject: Bug 18109

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	apple-gcc_os_35-branch
Changes by:	dalej@gcc.gnu.org	2005-02-14 23:24:52

Modified files:
	gcc            : ChangeLog.apple-ppc 
	gcc/config/i386: i386.md 

Log message:
	2005-02-14  Dale Johannesen  <dalej@apple.com>
	
	Radar 4003603
	PR 18109
	(Same as 3838108/3876378 in 4.0.)
	* config/i386/i386.md (movqi_1):  Don't use 4-byte load when unsafe.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-gcc_os_35-branch&r1=1.1.2.190.2.16&r2=1.1.2.190.2.17
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&only_with_tag=apple-gcc_os_35-branch&r1=1.374.2.42.2.5&r2=1.374.2.42.2.5.2.1

Comment 4 Dale Johannesen 2005-02-17 01:45:25 UTC
Please ignore comment #3, I had the bug number wrong.
Comment 5 GCC Commits 2005-02-17 01:56:27 UTC
Subject: Bug 18109

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	apple-ppc-branch
Changes by:	dalej@gcc.gnu.org	2005-02-17 01:56:12

Modified files:
	gcc            : ChangeLog.apple-ppc cse.c simplify-rtx.c 
	                 recog.c basic-block.h 
	gcc/config/i386: i386.md 

Log message:
	2005-02-16  Dale Johannesen  <dalej@apple.com>
	
	Radar 4006687
	PR 17767 et al (fix from mainline)
	* cse.c (fold_rtx) [RTX_COMPARE, RTX_COMM_COMPARE]: Don't attempt
	any simplifications of vector mode comparison operators.
	* simplify-rtx.c (simplify_relational_operation): Fix variable name.
	
	2005-02-15  Dale Johannesen  <dalej@apple.com>
	
	Radar 3991611
	Radar 3990578
	PRs 19084 and 19348 (fix from mainline)
	* recog.c (peephole2_optimize): Do global life update if some peephole
	decides it doesn't need at least one of its inputs and that change
	influences liveness at the start of the basic block.
	* basic-block.h (EXECUTE_IF_AND_COMPL_IN_REG_SET): Needs 2 REGSET
	arguments instead of 1.
	
	2005-02-15  Dale Johannesen  <dalej@apple.com>
	
	Radar 3876378
	Radar 3838108
	PR 18109 (fix from mainline)
	* config/i386/i386.md (movhi_1):  Remove previous attempt at a fix.
	(movqi_1):  Ditto.  Don't use 4-byte load when unsafe.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.1.2.308&r2=1.1.2.309
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cse.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.229.2.32.2.13&r2=1.229.2.32.2.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/simplify-rtx.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.107.2.31.2.11&r2=1.107.2.31.2.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/recog.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.159.2.24.2.8&r2=1.159.2.24.2.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/basic-block.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.153.2.48.2.10&r2=1.153.2.48.2.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.374.2.42.2.7&r2=1.374.2.42.2.8

Comment 6 GCC Commits 2005-05-31 17:19:23 UTC
Subject: Bug 18109

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pault@gcc.gnu.org	2005-05-31 17:19:12

Modified files:
	gcc/fortran    : ChangeLog trans-array.c trans-expr.c 

Log message:
	2005-05-30  Paul Thomas  <pault@gcc.gnu.org>
	
	PR fortran/18109
	PR fortran/18283
	PR fortran/19107
	* fortran/trans-array.c (gfc_conv_expr_descriptor): Obtain the
	string length from the expression typespec character length value
	and set temp_ss->stringlength and backend_decl. Obtain the
	tree expression from gfc_conv_expr rather than gfc_conv_expr_val.
	Dereference the expression to obtain the character.
	* fortran/trans-expr.c (gfc_conv_component_ref): Remove the
	dereference of scalar character pointer structure components.
	* fortran/trans-expr.c (gfc_trans_subarray_assign): Obtain the
	string length for the structure component from the component
	expression.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.444&r2=1.445
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-array.c.diff?cvsroot=gcc&r1=1.46&r2=1.47
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-expr.c.diff?cvsroot=gcc&r1=1.47&r2=1.48

Comment 7 GCC Commits 2005-06-05 08:59:35 UTC
Subject: Bug 18109

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	pault@gcc.gnu.org	2005-06-05 08:59:18

Modified files:
	gcc/fortran    : ChangeLog trans-array.c trans-expr.c 

Log message:
	005-05-31  Paul Thomas  <pault@gcc.gnu.org>
	
	PR fortran/18109
	PR fortran/18283
	PR fortran/19107
	PR fortran/16939
	PR fortran/17192
	PR fortran/17193
	PR fortran/17202
	PR fortran/18689
	PR fortran/18890
	* fortran/trans-array.c (gfc_conv_expr_descriptor): Obtain the
	string length from the expression typespec character length value
	and set temp_ss->stringlength and backend_decl. Obtain the
	tree expression from gfc_conv_expr rather than gfc_conv_expr_val.
	Dereference the expression to obtain the character.
	* fortran/trans-array.c (gfc_conv_resolve_dependencies): Add string
	length to temp_ss for character pointer array assignments.
	* fortran/trans-expr.c (gfc_conv_component_ref): Remove the
	dereference of scalar character pointer structure components.
	* fortran/trans-expr.c (gfc_trans_subarray_assign): Obtain the
	string length for the structure component from the component
	expression.
	* fortran/trans-expr.c (gfc_conv_variable): Correct errors in
	dereferencing of characters and character pointers.
	* fortran/trans-expr.c (gfc_conv_function_call): Provide string
	length as return argument for various kinds of handling of return.
	Return a char[]* temporary for character pointer functions and
	dereference the temporary upon return.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.66&r2=1.335.2.67
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-array.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.39.2.3&r2=1.39.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-expr.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.38.2.4&r2=1.38.2.5

Comment 8 Paul Thomas 2005-06-05 22:39:08 UTC
Fixed in 4.0 and 4.1