Very recent regression:

Program received signal SIGSEGV, Segmentation fault.
gfc_conv_array_stride (descriptor=0x0, dim=0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:2259
2259      type = TREE_TYPE (descriptor);
(gdb) bt
#0  gfc_conv_array_stride (descriptor=0x0, dim=0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:2259
#1  0x000000000055afb5 in gfc_conv_array_index_offset (se=0x7fff9584ab70,
info=0x143d930, dim=<value optimized out>, i=<value optimized out>,
    ar=0x1444538, stride=0x7f5a5fc5a780) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:2450
#2  0x000000000055b0c2 in gfc_conv_scalarized_array_ref (se=0x7fff9584ab70,
ar=0x30)
    at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:2524
#3  0x000000000055cdad in gfc_conv_array_ref (se=0x7fff9584ab70, ar=0x0,
sym=0x1441920, where=0x1444340)
    at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:2574
#4  0x000000000057c14a in gfc_conv_variable (se=0x7fff9584ab70, expr=0x14442f0)
at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-expr.c:731
#5  0x000000000057bb54 in gfc_conv_expr_val (se=0x7fff9584ab70, expr=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-expr.c:4662
#6  0x000000000055eb24 in gfc_conv_expr_descriptor (se=0x7fff9584ae60,
expr=0x14442f0, ss=0x143d910)
    at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:5414
#7  0x0000000000562005 in gfc_conv_array_parameter (se=0x7fff9584ae60,
expr=0x14442f0, ss=0x143d910, g77=1 '\001', fsym=0x0,
    proc_name=0x7f5a5fb6ff98 "m_loc_r", size=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:5836
#8  0x0000000000576717 in gfc_conv_procedure_call (se=0x7fff9584b360,
sym=0x1444080, args=0x13e25a0, expr=0x1444230, append_args=0x0)
    at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-expr.c:3073
#9  0x0000000000578f9a in gfc_conv_function_expr (se=0x7fff9584b360, expr=0x0)
at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-expr.c:3932
#10 0x000000000057b818 in gfc_conv_expr_reference (se=0x0, expr=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-expr.c:4736
#11 0x000000000058d10a in gfc_trans_transfer (code=0x1444b30) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-io.c:2246
#12 0x0000000000552700 in trans_code (code=0x1444b30, cond=0x7f5a617f13f0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans.c:1302
#13 0x000000000058fc89 in build_dt (function=0x7f5a5fc49e00, code=0x1444d70) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-io.c:1817
#14 0x0000000000552740 in trans_code (code=0x1444d70, cond=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans.c:1274
#15 0x0000000000599878 in gfc_trans_if_1 (code=0x1442550) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-stmt.c:733
#16 0x000000000059993a in gfc_trans_if (code=0x1442ac0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-stmt.c:763
#17 0x00000000005529a8 in trans_code (code=0x1442ac0, cond=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans.c:1205
#18 0x000000000059dd6e in gfc_trans_select (code=0x1442220) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-stmt.c:1529
#19 0x0000000000552928 in trans_code (code=0x1442220, cond=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans.c:1225
#20 0x000000000056e602 in gfc_generate_function_code (ns=0x1440d70) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-decl.c:4629
#21 0x00000000005520aa in gfc_generate_module_code (ns=0x143eaf0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans.c:1433
#22 0x0000000000515bcc in gfc_parse_file () at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/parse.c:4377

for the following testcase:

MODULE pw_types
  INTEGER, PARAMETER :: dp=8
  TYPE pw_type
     REAL (KIND=dp), DIMENSION ( : ), POINTER :: cr
     INTEGER :: in_use
  END TYPE pw_type
  INTEGER, PARAMETER, PUBLIC :: REALDATA1D = 301
CONTAINS
  SUBROUTINE pw_write(pw, unit_nr, error)
    TYPE(pw_type), INTENT(in)                :: pw
    INTEGER, INTENT(in)                      :: unit_nr
    SELECT CASE(pw%in_use)
    CASE (REALDATA1D)
       IF (ASSOCIATED(pw%cr)) THEN
          WRITE (unit=unit_nr, &
           fmt="(' cr=<real(',i8,':',i8,')at 0x',z16.16,'>')")&
           LBOUND(pw%cr,1),UBOUND(pw%cr,1),m_loc_r(pw%cr(LBOUND(pw%cr)))
       END IF
    END SELECT
  END SUBROUTINE pw_write
END MODULE

reproduce with:

> gfortran  bug.f90
bug.f90: In function ‘pw_write’:
bug.f90:17:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
           Summary: [4.6 Regression] ICE in gfc_conv_array_stride
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Joost dot VandeVondele at pci dot uzh dot ch


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

Reply via email to