------- Comment #3 from paul dot richard dot thomas at cea dot fr 2006-08-08 14:15 ------- (In reply to comment #2) > I wonder if this was caused by Jakub's patches for openmp.
Or Richard Sandiford's patches. The above produces: gee () { int4 .s; __builtin_memmove (&(*(char[0:][1:3] *) m.data)[NON_LVALUE_EXPR <m.dim[0].stri de> + m.offset], s, 3); } bar (s, n, _s) { struct array1_unknown m; bit_size_type D.914; <unnamed type> D.915; static void gee (void); .s = *n; D.914 = (bit_size_type) (<unnamed type>) .s * 8; D.915 = (<unnamed type>) .s; m.data = 0B; } so that .s is declared in gee but used in bar. This: subroutine bar(s, n) integer n character s*(*) character*3, dimension(:), pointer :: m contains subroutine gee m(1) = s(1:3) end subroutine gee end subroutine bar compiles correctly and outputs this code: gee () { __builtin_memmove (&(*(char[0:][1:3] *) m.data)[NON_LVALUE_EXPR <m.dim[0].stri de> + m.offset], s, 3); bar (s, n, _s) { struct array1_unknown m; bit_size_type D.913; <unnamed type> D.914; static void gee (void); D.913 = (bit_size_type) (<unnamed type>) _s * 8; D.914 = (<unnamed type>) _s; m.data = 0B; } where _s is used directly. The declaration for .s needs to be boosted to the correct context. Paul -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28600