Hi,
when compiling and linking the following program:
% cat openmp-test.F90
implicit none
#if _OPENMP >= 200505
!$ integer :: OMP_GET_NUM_THREADS, OMP_GET_MAX_THREADS, OMP_GET_THREAD_NUM
#else
integer :: OMP_GET_NUM_THREADS, OMP_GET_MAX_THREADS, OMP_GET_THREAD_NUM
#endif
integer :: i
print *, "OpenMP version:", _OPENMP
print *
!$OMP parallel do
do i = 1, OMP_GET_MAX_THREADS ()
print *, "OMP_GET_THREAD_NUM
=",OMP_GET_THREAD_NUM(),OMP_GET_NUM_THREADS()
end do
!$OMP end parallel do
end program
% gfc4x -O -g -fopenmp openmp-test.F90 -fwhopr
lto1: error: missing callgraph edge for call stmt:
# .MEM_26 = VDEF <.MEM_25>
_gfortran_st_write (&dt_parm.2);
lto1: error: missing callgraph edge for call stmt:
# .MEM_27 = VDEF <.MEM_26>
_gfortran_transfer_character (&dt_parm.2, &"OMP_GET_THREAD_NUM ="[1]{lb: 1 sz:
1}, 20);
lto1: error: edge points to wrong declaration:
<function_decl 0x2b9f7e45bb00 _gfortran_st_write
type <function_type 0x2b9f7e461300
type <void_type 0x2b9f7db08f00 VOID
align 8 symtab 0 alias set -1 canonical type 0x2b9f7db08f00
pointer_to_this <pointer_type 0x2b9f7db16000>>
QI
size <integer_cst 0x2b9f7dafa810 constant 8>
unit size <integer_cst 0x2b9f7dafa840 constant 1>
align 8 symtab 0 alias set -1 canonical type 0x2b9f7e461300
arg-types <tree_list 0x2b9f7e460d80 value <pointer_type 0x2b9f7e45ad80>
chain <tree_list 0x2b9f7e460db0 value <void_type 0x2b9f7db08f00>>>
pointer_to_this <pointer_type 0x2b9f7e461a80>>
public external QI file (null) line 0 col 0 align 8>
Instead of: <function_decl 0x2b9f7e45b600 omp_get_thread_num
type <function_type 0x2b9f7e45ac00
type <integer_type 0x2b9f7db08540 public SI
[...more output...]
lto1: internal compiler error: verify_cgraph_node failed
and similar for -flto.
The error disappears when either -O, -g, -fwhopr or -flto are
removed.
Cheers,
-ha
--
Summary: ICE with -fopenmp -O -g and -fwhopr or -flto
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: anlauf at gmx dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41694