This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/68283] [5/6 Regression] ice: gfc_variable_attr(): Bad array reference


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68283

--- Comment #10 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The reduced test with only one error

MODULE neb_utils
  IMPLICIT NONE
  INTEGER, PARAMETER :: dp=8
  TYPE neb_var_type
     REAL(KIND=dp), DIMENSION(:, :),  POINTER  :: xyz, int, wrk
  END TYPE neb_var_type
CONTAINS
  RECURSIVE SUBROUTINE get_neb_force(&
      )
    INTEGER                                  :: i
    TYPE(neb_var_type), POINTER              :: forces
    REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: dtmp1, wrk
       dtmp1       = forces%wrk(:,i)- &
    dot_product_band(neb_env,forces%wrk(:,i))
  END SUBROUTINE get_neb_force
END MODULE neb_utils

still gives the ICE

pr68283_db_2.f90:15:28:

     dot_product_band(neb_env,forces%wrk(:,i))
                            1

Error: Symbol 'neb_env' at (1) has no IMPLICIT type
f951: internal compiler error: gfc_variable_attr(): Bad array reference
...

Backtrace is

Program received signal SIGABRT, Aborted.
0x00007fff91ac0286 in __pthread_kill () from
/usr/lib/system/libsystem_kernel.dylib
(gdb) bt
#0  0x00007fff91ac0286 in __pthread_kill () from
/usr/lib/system/libsystem_kernel.dylib
#1  0x00007fff8ab039f9 in pthread_kill () from
/usr/lib/system/libsystem_pthread.dylib
#2  0x00007fff8dbb29b3 in abort () from /usr/lib/system/libsystem_c.dylib
#3  0x0000000100fca611 in uw_init_context_1 (context=0x6,
outer_cfa=0x7fff5fbfea70, outer_ra=0x100f24879 <backtrace_full+105>)
    at ../../../work/libgcc/unwind-dw2.c:1563
#4  0x0000000100fcb078 in _Unwind_Backtrace (trace=0x100f24780 <unwind>,
trace_argument=0x7fff739ce300) at ../../../work/libgcc/unwind.inc:283
#5  0x0000000100f24879 in backtrace_full (state=0x1425f9000, skip=<optimized
out>, callback=<optimized out>, error_callback=<optimized out>, 
    data=<optimized out>) at ../../work/libbacktrace/backtrace.c:127
#6  0x0000000100edfb33 in diagnostic_action_after_output (context=0x1418c8d00,
diag_kind=<optimized out>) at ../../work/gcc/diagnostic.c:460
#7  0x0000000100edfd6e in diagnostic_report_diagnostic (context=0x1418c8d00,
diagnostic=0x7fff5fbfeb40) at ../../work/gcc/diagnostic.c:801
#8  0x00000001000327e3 in gfc_internal_error (gmsgid=<optimized out>) at
../../work/gcc/fortran/error.c:1295
#9  0x0000000100090ef1 in gfc_variable_attr (expr=<optimized out>, ts=0x0) at
../../work/gcc/fortran/primary.c:2272
#10 0x0000000100090f20 in gfc_expr_attr (e=<optimized out>) at
../../work/gcc/fortran/primary.c:2351
#11 0x00000001000cb4be in gfc_check_dependency (expr1=<optimized out>,
expr2=<optimized out>, identical=<optimized out>)
    at ../../work/gcc/fortran/dependency.c:1292
#12 0x00000001000cb423 in gfc_check_dependency (expr1=<optimized out>,
expr2=<optimized out>, identical=<optimized out>)
    at ../../work/gcc/fortran/dependency.c:1260
#13 0x00000001001743ec in optimize_code (c=<optimized out>,
walk_subtrees=<optimized out>, data=<optimized out>)
    at ../../work/gcc/fortran/frontend-passes.c:1160
#14 0x0000000100176f04 in gfc_code_walker (c=<optimized out>, codefn=<optimized
out>, exprfn=<optimized out>, data=<optimized out>)
    at ../../work/gcc/fortran/frontend-passes.c:3260
#15 0x000000010017812c in optimize_namespace (ns=<optimized out>) at
../../work/gcc/fortran/frontend-passes.c:984
#16 0x0000000100178169 in optimize_namespace (ns=<optimized out>) at
../../work/gcc/fortran/frontend-passes.c:993
#17 0x0000000100178338 in gfc_run_passes (ns=<optimized out>) at
../../work/gcc/fortran/frontend-passes.c:127
#18 0x00000001000a43d0 in gfc_resolve (ns=<optimized out>) at
../../work/gcc/fortran/resolve.c:15479
#19 0x000000010008cec1 in gfc_parse_file () at
../../work/gcc/fortran/parse.c:5715
#20 0x00000001000d3c9b in gfc_be_parse_file () at
../../work/gcc/fortran/f95-lang.c:199
#21 0x0000000100af328a in compile_file () at ../../work/gcc/toplev.c:466
#22 0x0000000100fcf24c in ?? ()
#23 0x0000000100fd0c09 in main (argc=3, argv=0x7fff5fbff2f8) at
../../work/gcc/main.c:39

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]