See thread at http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/e9add97708681397
Full example, reported by James Van Buskirk, see http://groups.google.com/group/comp.lang.fortran/msg/9c42edc4620a1cff Using -frepack-arrays, the dummy array "x" is repacked in the function. This repacking should not happen if the TARGET attribute is present as this can lead to wrong code. (The result symbol "point" points to the repacked array and not to the original array.) function point(x) real, intent(in), target :: x(:) type(C_PTR) point real, pointer :: p p => x(2) point = C_LOC(p) end function point -- Summary: -frepack-arrays: symbols w/ TARGET should not be repacked Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36059