This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/17584] gfortran: ICE with segfault on valid code w/ allocate within derived type
- From: "tobi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Sep 2004 17:40:01 -0000
- Subject: [Bug fortran/17584] gfortran: ICE with segfault on valid code w/ allocate within derived type
- References: <20040921142339.17584.anlauf@hep.tu-darmstadt.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tobi at gcc dot gnu dot org 2004-09-25 17:39 -------
Backtrace from the segfault:
#0 tree_swap_operands_p (arg0=0xf6e5d0d8, arg1=0x0, reorder=1 '\001')
at ../../gcc-clean/gcc/fold-const.c:5921
#1 0x082219e8 in fold (expr=0xf6ec7360)
at ../../gcc-clean/gcc/fold-const.c:6080
#2 0x08096c8b in gfc_array_allocate (se=0xfef9d8fc, ref=0xa35e398,
pstat=0xf6e5d0d8) at ../../gcc-clean/gcc/fortran/trans-array.c:2725
#3 0x080b56ea in gfc_trans_allocate (code=0xa35e4c8)
at ../../gcc-clean/gcc/fortran/trans-stmt.c:3054
#4 0x08093228 in gfc_trans_code (code=0xa35e4c8)
at ../../gcc-clean/gcc/fortran/trans.c:573
#5 0x080a1c1e in gfc_generate_function_code (ns=0xa35dc30)
at ../../gcc-clean/gcc/fortran/trans-decl.c:2217
#6 0x080934d2 in gfc_generate_module_code (ns=0xa35d3c0)
at ../../gcc-clean/gcc/fortran/trans.c:708
#7 0x08079ae4 in gfc_parse_file () at ../../gcc-clean/gcc/fortran/parse.c:2618
#8 0x0809052d in gfc_be_parse_file (set_yydebug=0)
at ../../gcc-clean/gcc/fortran/f95-lang.c:265
#9 0x083b3f77 in toplev_main (argc=167, argv=0xfef9db84)
at ../../gcc-clean/gcc/toplev.c:991
#10 0x0030bad4 in __libc_start_main () from /lib/tls/libc.so.6
#11 0x0804ab01 in _start ()
In frame #2, we're here:
(gdb) up
#2 0x08096c48 in gfc_array_init_size (descriptor=0xf6e4a028, rank=1,
poffset=0xfef4785c, lower=0x0, upper=0xa0ce3e8, pblock=0xfef4789c)
at ../../gcc-clean/gcc/fortran/trans-array.c:2725
2725 size = fold (build2 (MULT_EXPR, gfc_array_index_type, stride, tmp));
(gdb) l
2720 }
2721
2722 /* The stride is the number of elements in the array, so multiply by the
2723 size of an element to get the total size. */
2724 tmp = TYPE_SIZE_UNIT (gfc_get_element_type (type));
2725 size = fold (build2 (MULT_EXPR, gfc_array_index_type, stride, tmp));
2726
2727 if (poffset != NULL)
2728 {
2729 offset = gfc_evaluate_now (offset, pblock);
(gdb)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17584