public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/18890] New: ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one
@ 2004-12-08 17:39 naf at naf dot net dot ru
  2004-12-08 18:06 ` [Bug fortran/18890] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: naf at naf dot net dot ru @ 2004-12-08 17:39 UTC (permalink / raw)
  To: gcc-bugs

Example code:
$ cat alloc.f90
INTEGER ERR,N                                                                   
PARAMETER (N=10)                                                                
CHARACTER(LEN=40), POINTER :: vPTR(:)                                           
CHARACTER(LEN=40), ALLOCATABLE :: vALLOC(:)                                     
                                                                                
ALLOCATE(vPTR(N),STAT=ERR)                                                      
ALLOCATE(vALLOC(N),STAT=ERR)                                                    
vALLOC='A'                                                                      
                                                                                
vPTR=vALLOC     ! Line cause compiler error                                     
                                                                                
WRITE(*,*) vPTR                                                                 
DEALLOCATE(vPTR,STAT=ERR)                                                       
DEALLOCATE(vALLOC,STAT=ERR)                                                     
END                                                                             

When compiling it an internal compiler errors arises:

$ /usr/local/bin/gfortran/irun/bin/gfortran -static -v --save-temps alloc.f90
Driving: /usr/local/bin/gfortran/irun/bin/gfortran -static -v -save-temps
alloc.f90 -lgfortranbegin -lgfortran -lm
Reading specs from
/usr/local/bin/gfortran/irun/bin/../lib/gcc/i686-pc-linux-gnu/4.0.0/specs
Configured with: ../gcc/configure --enable-languages=c,f95
--prefix=/usr/work/2004343/irun
Thread model: posix
gcc version 4.0.0 20041208 (experimental)
 /usr/local/bin/gfortran/irun/bin/../libexec/gcc/i686-pc-linux-gnu/4.0.0/f951
alloc.f90 -quiet -dumpbase alloc.f90 -mtune=pentiumpro -auxbase alloc -version
-o alloc.s
GNU F95 version 4.0.0 20041208 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.0 20041202 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
alloc.f90: In function 'MAIN__':
alloc.f90:11: internal compiler error: in gfc_trans_scalar_assign, at
fortran/trans-expr.c:2005
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


ICE appears with CHARACTER type, REAL or INTEGER seems ok.
ICE appears only with POINTER to POINTER or mixed POINTER to/from 
ALLOCATABLE arrays assigning, ALLOCATABLE to ALLOCATABLE have works.

-- 
           Summary: ICE at assign CHARACTER POINTER array to POINTER or
                    ALLOCATABLE one
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: naf at naf dot net dot ru
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18890


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/18890] ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one
  2004-12-08 17:39 [Bug fortran/18890] New: ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one naf at naf dot net dot ru
@ 2004-12-08 18:06 ` pinskia at gcc dot gnu dot org
  2005-04-25  0:27 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-08 18:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-08 18:06 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-12-08 18:06:32
               date|                            |
            Version|tree-ssa                    |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18890


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/18890] ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one
  2004-12-08 17:39 [Bug fortran/18890] New: ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one naf at naf dot net dot ru
  2004-12-08 18:06 ` [Bug fortran/18890] " pinskia at gcc dot gnu dot org
@ 2005-04-25  0:27 ` pinskia at gcc dot gnu dot org
  2005-05-29 16:03 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-25  0:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-25 00:27 -------
*** Bug 21197 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |enok at lysator dot liu dot
                   |                            |se


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18890


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/18890] ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one
  2004-12-08 17:39 [Bug fortran/18890] New: ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one naf at naf dot net dot ru
  2004-12-08 18:06 ` [Bug fortran/18890] " pinskia at gcc dot gnu dot org
  2005-04-25  0:27 ` pinskia at gcc dot gnu dot org
@ 2005-05-29 16:03 ` cvs-commit at gcc dot gnu dot org
  2005-06-05  9:00 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-29 16:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-05-29 16:02 -------
Subject: Bug 18890

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pault@gcc.gnu.org	2005-05-29 16:02:11

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

Log message:
	2005-05-29 Paul Thomas  <pault@gcc.gnu.org>
	
	PR fortran/16939
	PR fortran/17192
	PR fortran/17193
	PR fortran/17202
	PR fortran/18689
	PR fortran/18890
	PR fortran/21297
	* 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_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/trans-array.c.diff?cvsroot=gcc&r1=1.45&r2=1.46
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-expr.c.diff?cvsroot=gcc&r1=1.44&r2=1.45



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18890


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/18890] ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one
  2004-12-08 17:39 [Bug fortran/18890] New: ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one naf at naf dot net dot ru
                   ` (2 preceding siblings ...)
  2005-05-29 16:03 ` cvs-commit at gcc dot gnu dot org
@ 2005-06-05  9:00 ` cvs-commit at gcc dot gnu dot org
  2005-06-05 22:47 ` pault at gcc dot gnu dot org
  2005-06-05 22:54 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-06-05  9:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-06-05 08:59 -------
Subject: Bug 18890

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



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18890


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/18890] ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one
  2004-12-08 17:39 [Bug fortran/18890] New: ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one naf at naf dot net dot ru
                   ` (3 preceding siblings ...)
  2005-06-05  9:00 ` cvs-commit at gcc dot gnu dot org
@ 2005-06-05 22:47 ` pault at gcc dot gnu dot org
  2005-06-05 22:54 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2005-06-05 22:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pault at gcc dot gnu dot org  2005-06-05 22:47 -------
Fixed in 4.0 and 4.1

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18890


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/18890] ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one
  2004-12-08 17:39 [Bug fortran/18890] New: ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one naf at naf dot net dot ru
                   ` (4 preceding siblings ...)
  2005-06-05 22:47 ` pault at gcc dot gnu dot org
@ 2005-06-05 22:54 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-05 22:54 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18890


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-06-05 22:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-08 17:39 [Bug fortran/18890] New: ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one naf at naf dot net dot ru
2004-12-08 18:06 ` [Bug fortran/18890] " pinskia at gcc dot gnu dot org
2005-04-25  0:27 ` pinskia at gcc dot gnu dot org
2005-05-29 16:03 ` cvs-commit at gcc dot gnu dot org
2005-06-05  9:00 ` cvs-commit at gcc dot gnu dot org
2005-06-05 22:47 ` pault at gcc dot gnu dot org
2005-06-05 22:54 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).