public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25681]  New: Segmentation fault, when accessing len(attribute) of multidimensional object
@ 2006-01-05 16:38 Heiko dot Klein at gmx dot net
  2006-01-05 16:40 ` [Bug fortran/25681] " Heiko dot Klein at gmx dot net
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Heiko dot Klein at gmx dot net @ 2006-01-05 16:38 UTC (permalink / raw)
  To: gcc-bugs

Accessing something like len(f_2d%class) where f_2d is a multidimensional
object gives a segmentation fault in the compiler.

Example:

module testLen
  implicit none
  public :: Derived
  type, public:: Deriv
     character(len=9) :: class
  end type Deriv

  type(Deriv), private, dimension(2) :: f_2d


contains

  subroutine Derived()
    character(len=len(f_2d%class)) :: typ  !  See defs of f_2d

    typ = "Hallo    "
  end subroutine Derived

end module testLen


-- 
           Summary: Segmentation fault, when accessing len(attribute) of
                    multidimensional object
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Heiko dot Klein at gmx dot net
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



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

* [Bug fortran/25681] Segmentation fault, when accessing len(attribute) of multidimensional object
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
@ 2006-01-05 16:40 ` Heiko dot Klein at gmx dot net
  2006-01-05 16:47 ` [Bug fortran/25681] ICE with len of array of derived type pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Heiko dot Klein at gmx dot net @ 2006-01-05 16:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from Heiko dot Klein at gmx dot net  2006-01-05 16:40 -------
Created an attachment (id=10584)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10584&action=view)
test-code as attachment


-- 


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



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

* [Bug fortran/25681] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
  2006-01-05 16:40 ` [Bug fortran/25681] " Heiko dot Klein at gmx dot net
@ 2006-01-05 16:47 ` pinskia at gcc dot gnu dot org
  2006-01-05 18:11 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-05 16:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-01-05 16:47 -------
Confirmed, reduced testcase:
subroutine Derived()
    type Deriv
       character(len=9) :: class
    end type Deriv
    type(Deriv),  dimension(2) :: f_2d

    i = len(f_2d%class)
end subroutine Derived


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
           Keywords|                            |ice-on-valid-code
      Known to fail|4.0.0                       |
            Summary|Segmentation fault, when    |ICE with len of array of
                   |accessing len(attribute) of |derived type
                   |multidimensional object     |


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



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

* [Bug fortran/25681] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
  2006-01-05 16:40 ` [Bug fortran/25681] " Heiko dot Klein at gmx dot net
  2006-01-05 16:47 ` [Bug fortran/25681] ICE with len of array of derived type pinskia at gcc dot gnu dot org
@ 2006-01-05 18:11 ` pinskia at gcc dot gnu dot org
  2006-02-06 18:31 ` fxcoudert at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-05 18:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-01-05 18:11 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-01-05 18:11:08
               date|                            |


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



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

* [Bug fortran/25681] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
                   ` (2 preceding siblings ...)
  2006-01-05 18:11 ` pinskia at gcc dot gnu dot org
@ 2006-02-06 18:31 ` fxcoudert at gcc dot gnu dot org
  2006-03-19 17:15 ` jb at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-02-06 18:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from fxcoudert at gcc dot gnu dot org  2006-02-06 18:30 -------
Here is the backtrace for this bug:

Program received signal SIGSEGV, Segmentation fault.
0x080a4583 in gfc_conv_scalarized_array_ref (se=0xbfaf2924, ar=0x86f5d0c)
    at ../../../trunk/gcc/fortran/trans-array.c:1885
1885        n = se->loop->order[0];
(gdb) where
#0  0x080a4583 in gfc_conv_scalarized_array_ref (se=0xbfaf2924, ar=0x86f5d0c)
    at ../../../trunk/gcc/fortran/trans-array.c:1885
#1  0x080a4dfd in gfc_conv_array_ref (se=0xbfaf2924, ar=0x86f5d0c)
    at ../../../trunk/gcc/fortran/trans-array.c:1929
#2  0x080b2d87 in gfc_conv_expr (se=0xbfaf2924, expr=0x86f5cb0)
    at ../../../trunk/gcc/fortran/trans-expr.c:429
#3  0x080ba1df in gfc_conv_intrinsic_len (se=0xbfaf302c, expr=Variable "expr"
is not available.
)
    at ../../../trunk/gcc/fortran/trans-intrinsic.c:2113
#4  0x080b61bf in gfc_conv_function_expr (se=0xbfaf302c, expr=Variable "expr"
is not available.
)
    at ../../../trunk/gcc/fortran/trans-expr.c:2251
#5  0x080b26b9 in gfc_conv_expr (se=0xbfaf302c, expr=0x86f5bd8)
    at ../../../trunk/gcc/fortran/trans-expr.c:2614
#6  0x080b6a6a in gfc_trans_assignment (expr1=0x86f5968, expr2=0x86f5bd8)
    at ../../../trunk/gcc/fortran/trans-expr.c:3053
#7  0x080b6d09 in gfc_trans_assign (code=0x86f5ea8)
    at ../../../trunk/gcc/fortran/trans-expr.c:3115
#8  0x0809ffd8 in gfc_trans_code (code=0x86f5ea8)
    at ../../../trunk/gcc/fortran/trans.c:455
#9  0x080b0732 in gfc_generate_function_code (ns=0x86f4ef8)
    at ../../../trunk/gcc/fortran/trans-decl.c:2639
#10 0x08082ead in gfc_parse_file () at ../../../trunk/gcc/fortran/parse.c:2686
#11 0x0809f15d in gfc_be_parse_file (set_yydebug=0)
    at ../../../trunk/gcc/fortran/f95-lang.c:287


A more reduced testcase is:

  TYPE T
    CHARACTER(LEN=80) :: S(1)
  END TYPE T
  TYPE(T), POINTER :: TT
  PRINT *, LEN(TT % S)
  END


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2006-01-27 20:48:30         |2006-02-06 18:30:57
               date|                            |


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


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

* [Bug fortran/25681] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
                   ` (3 preceding siblings ...)
  2006-02-06 18:31 ` fxcoudert at gcc dot gnu dot org
@ 2006-03-19 17:15 ` jb at gcc dot gnu dot org
  2006-04-27  9:49 ` fxcoudert at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jb at gcc dot gnu dot org @ 2006-03-19 17:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jb at gcc dot gnu dot org  2006-03-19 17:15 -------
An even more reduced testcase is

program char_type_len
  type foo_t
     character ( LEN = 80 ) :: bar (1)
  end type foo_t
  type(foo_t) :: foo
  print *, len (foo%bar)
end program char_type_len

I.e. it's not necessary for the "foo" variable to be a pointer. 

This bug is one of the issues preventing cp2k from compiling. I get this error
in timings.f90:335.


-- 

jb at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jb at gcc dot gnu dot org


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


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

* [Bug fortran/25681] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
                   ` (4 preceding siblings ...)
  2006-03-19 17:15 ` jb at gcc dot gnu dot org
@ 2006-04-27  9:49 ` fxcoudert at gcc dot gnu dot org
  2006-04-27 11:50 ` patchapp at dberlin dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-04-27  9:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from fxcoudert at gcc dot gnu dot org  2006-04-27 09:49 -------
(In reply to comment #5)
> This bug is one of the issues preventing cp2k from compiling. I get this error
> in timings.f90:335.

This bug is still there. With mainline, on i686-linux, it seems to be the only
remaining bug preventing cp2k from building.

I might have an idea for a partial patch. I'll try to clean it up a bit and
post it to the list soon.

[Adding Joost in CC list]


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org, jv244 at cam dot ac dot
                   |                            |uk
   Last reconfirmed|2006-02-06 18:30:57         |2006-04-27 09:49:21
               date|                            |


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


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

* [Bug fortran/25681] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
                   ` (6 preceding siblings ...)
  2006-04-27 11:50 ` patchapp at dberlin dot org
@ 2006-04-27 11:50 ` fxcoudert at gcc dot gnu dot org
  2006-04-27 12:53 ` jv244 at cam dot ac dot uk
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-04-27 11:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from fxcoudert at gcc dot gnu dot org  2006-04-27 11:50 -------
Patch (at least partial) submitted for approval. The patch allows CP2K to
compile.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2006-
                   |                            |04/msg01033.html
           Keywords|                            |patch


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


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

* [Bug fortran/25681] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
                   ` (5 preceding siblings ...)
  2006-04-27  9:49 ` fxcoudert at gcc dot gnu dot org
@ 2006-04-27 11:50 ` patchapp at dberlin dot org
  2006-04-27 11:50 ` fxcoudert at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: patchapp at dberlin dot org @ 2006-04-27 11:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from patchapp at dberlin dot org  2006-04-27 11:50 -------
Subject: Bug number PR fortran/25681

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-04/msg01033.html


-- 


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


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

* [Bug fortran/25681] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
                   ` (7 preceding siblings ...)
  2006-04-27 11:50 ` fxcoudert at gcc dot gnu dot org
@ 2006-04-27 12:53 ` jv244 at cam dot ac dot uk
  2006-04-29 16:31 ` fxcoudert at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jv244 at cam dot ac dot uk @ 2006-04-27 12:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jv244 at cam dot ac dot uk  2006-04-27 12:53 -------
> [Adding Joost in CC list]

Thanks. Any idea if it runs properly with the patch in place (have a look at
the script cp2k/tools/do_regtest for setting up a testing run) ?


-- 


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


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

* [Bug fortran/25681] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
                   ` (8 preceding siblings ...)
  2006-04-27 12:53 ` jv244 at cam dot ac dot uk
@ 2006-04-29 16:31 ` fxcoudert at gcc dot gnu dot org
  2006-04-29 16:32 ` [Bug fortran/25681] [4.0 only] " fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-04-29 16:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from fxcoudert at gcc dot gnu dot org  2006-04-29 16:31 -------
Subject: Bug 25681

Author: fxcoudert
Date: Sat Apr 29 16:31:26 2006
New Revision: 113376

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113376
Log:
        PR fortran/25681

        * simplify.c (simplify_len): Character variables with constant
        length can be simplified.

        * gfortran.df/char_type_len.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/char_type_len.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/simplify.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/25681] [4.0 only] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
                   ` (9 preceding siblings ...)
  2006-04-29 16:31 ` fxcoudert at gcc dot gnu dot org
@ 2006-04-29 16:32 ` fxcoudert at gcc dot gnu dot org
  2006-05-05  9:01 ` fxcoudert at gcc dot gnu dot org
  2006-05-05  9:02 ` [Bug fortran/25681] " fxcoudert at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-04-29 16:32 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
      Known to fail|                            |4.1.1
      Known to work|                            |4.2.0
   Last reconfirmed|2006-04-27 09:49:21         |2006-04-29 16:32:19
               date|                            |
            Summary|ICE with len of array of    |[4.0 only] ICE with len of
                   |derived type                |array of derived type


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


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

* [Bug fortran/25681] [4.0 only] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
                   ` (10 preceding siblings ...)
  2006-04-29 16:32 ` [Bug fortran/25681] [4.0 only] " fxcoudert at gcc dot gnu dot org
@ 2006-05-05  9:01 ` fxcoudert at gcc dot gnu dot org
  2006-05-05  9:02 ` [Bug fortran/25681] " fxcoudert at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-05-05  9:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from fxcoudert at gcc dot gnu dot org  2006-05-05 09:00 -------
Subject: Bug 25681

Author: fxcoudert
Date: Fri May  5 09:00:25 2006
New Revision: 113551

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113551
Log:
        PR fortran/25681

        * simplify.c (simplify_len): Character variables with constant
        length can be simplified.

        * gfortran.df/char_type_len.f90: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/char_type_len.f90
      - copied unchanged from r113376,
trunk/gcc/testsuite/gfortran.dg/char_type_len.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/simplify.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/25681] ICE with len of array of derived type
  2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
                   ` (11 preceding siblings ...)
  2006-05-05  9:01 ` fxcoudert at gcc dot gnu dot org
@ 2006-05-05  9:02 ` fxcoudert at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-05-05  9:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from fxcoudert at gcc dot gnu dot org  2006-05-05 09:01 -------
Fixed on mainline and 4.1.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|i686-pc-linux-gnu           |
      Known to fail|4.1.1                       |
      Known to work|4.2.0                       |
         Resolution|                            |FIXED
            Summary|[4.0 only] ICE with len of  |ICE with len of array of
                   |array of derived type       |derived type
   Target Milestone|---                         |4.1.1


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


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

end of thread, other threads:[~2006-05-05  9:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-05 16:38 [Bug fortran/25681] New: Segmentation fault, when accessing len(attribute) of multidimensional object Heiko dot Klein at gmx dot net
2006-01-05 16:40 ` [Bug fortran/25681] " Heiko dot Klein at gmx dot net
2006-01-05 16:47 ` [Bug fortran/25681] ICE with len of array of derived type pinskia at gcc dot gnu dot org
2006-01-05 18:11 ` pinskia at gcc dot gnu dot org
2006-02-06 18:31 ` fxcoudert at gcc dot gnu dot org
2006-03-19 17:15 ` jb at gcc dot gnu dot org
2006-04-27  9:49 ` fxcoudert at gcc dot gnu dot org
2006-04-27 11:50 ` patchapp at dberlin dot org
2006-04-27 11:50 ` fxcoudert at gcc dot gnu dot org
2006-04-27 12:53 ` jv244 at cam dot ac dot uk
2006-04-29 16:31 ` fxcoudert at gcc dot gnu dot org
2006-04-29 16:32 ` [Bug fortran/25681] [4.0 only] " fxcoudert at gcc dot gnu dot org
2006-05-05  9:01 ` fxcoudert at gcc dot gnu dot org
2006-05-05  9:02 ` [Bug fortran/25681] " fxcoudert 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).