public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29396]  New: segfault with character pointer association
@ 2006-10-08 21:46 fxcoudert at gcc dot gnu dot org
  2006-10-08 21:46 ` [Bug fortran/29396] " fxcoudert at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-10-08 21:46 UTC (permalink / raw)
  To: gcc-bugs

$ cat a3.f90
  CHARACTER(LEN=2), DIMENSION(:), POINTER :: a 
  CHARACTER(LEN=4), DIMENSION(3), TARGET :: b 
  b=(/"bbbb","bbbb","bbbb"/) 
  a=>b(:)(2:3) 
  a="aa" 
  IF (ANY(b.NE.(/"baab","baab","baab"/))) CALL ABORT() 
  END 
$ gfortran a3.f90 
a3.f90:0: internal compiler error: Segmentation fault


gdb backtrace is:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004179b2 in gfc_check_pointer_assign (lvalue=0xce3ae0, 
    rvalue=0xce3de0) at ../../trunk/gcc/fortran/expr.c:2330
2330      if (lvalue->ts.type == BT_CHARACTER
(gdb) where
#0  0x00000000004179b2 in gfc_check_pointer_assign (lvalue=0xce3ae0, 
    rvalue=0xce3de0) at ../../trunk/gcc/fortran/expr.c:2330
#1  0x000000000044a349 in resolve_code (code=0xce42c0, ns=0xce2380)
    at ../../trunk/gcc/fortran/resolve.c:4967
#2  0x000000000044b765 in gfc_resolve (ns=0xce2380)
    at ../../trunk/gcc/fortran/resolve.c:6919
#3  0x0000000000440a68 in gfc_parse_file ()
    at ../../trunk/gcc/fortran/parse.c:3212

2330      if (lvalue->ts.type == BT_CHARACTER
2331            && lvalue->ts.cl->length && rvalue->ts.cl->length
2332            && abs (gfc_dep_compare_expr (lvalue->ts.cl->length,
2333                                          rvalue->ts.cl->length)) == 1)

(gdb) p lvalue->ts
$1 = {type = BT_CHARACTER, kind = 1, derived = 0x0, cl = 0xcb0800}
(gdb) p rvalue->ts
$2 = {type = BT_CHARACTER, kind = 1, derived = 0x0, cl = 0x0}

So rvalue->ts.cl->length should not be referenced.


-- 
           Summary: segfault with character pointer association
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-09-16  9:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-08 21:46 [Bug fortran/29396] New: segfault with character pointer association fxcoudert at gcc dot gnu dot org
2006-10-08 21:46 ` [Bug fortran/29396] " fxcoudert at gcc dot gnu dot org
2007-01-28 22:15 ` jvdelisle at gcc dot gnu dot org
2007-01-30 23:24 ` jvdelisle at gcc dot gnu dot org
2007-03-16 15:14 ` fxcoudert at gcc dot gnu dot org
2007-03-16 15:16 ` fxcoudert at gcc dot gnu dot org
2007-03-16 19:30 ` fxcoudert at gcc dot gnu dot org
2007-05-05 22:55 ` jvdelisle at gcc dot gnu dot org
2007-09-03 11:46 ` pault at gcc dot gnu dot org
2007-09-10  2:42 ` patchapp at dberlin dot org
2007-09-16  9:18 ` pault at gcc dot gnu dot org
2007-09-16  9:40 ` pault 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).