diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 2b46228d221..0c46c5b5df3 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2007-07-18 Christopher D. Rickett + + PR fortran/32801 + * symbol.c (generate_isocbinding_symbol): Fix bug where + ISOCBINDING_FUNPTR was generated for C_LOC instead of the needed + ISOCBINDING_PTR. + 2007-07-17 Janus Weil PR fortran/32535 diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index e83c190ebcd..30afd4bf0f2 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -3766,8 +3766,10 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s, processing the file. */ generate_isocbinding_symbol (mod_name, s == ISOCBINDING_FUNLOC - ? ISOCBINDING_FUNPTR : ISOCBINDING_FUNPTR, + || s == ISOCBINDING_F_PROCPOINTER + ? ISOCBINDING_FUNPTR : ISOCBINDING_PTR, (char *)(s == ISOCBINDING_FUNLOC + || s == ISOCBINDING_F_PROCPOINTER ? "_gfortran_iso_c_binding_c_funptr" : "_gfortran_iso_c_binding_c_ptr")); tmp_sym->ts.derived = diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1cac0885304..9ada9e84664 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-07-18 Christopher D. Rickett + + PR fortran/32801 + * gfortran.dg/pr32801.f03: New test case. + 2007-07-18 Kaveh R. Ghazi * gcc.dg/c99-math-double-1.c: Mark test variables as volatile. diff --git a/gcc/testsuite/gfortran.dg/pr32801.f03 b/gcc/testsuite/gfortran.dg/pr32801.f03 new file mode 100644 index 00000000000..10439240e76 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr32801.f03 @@ -0,0 +1,6 @@ +! { dg-do compile } +! Verify that C_PTR is auto generated because it's needed by C_LOC. +! This tests that PR 32801 is fixed. +PROGRAM c_loc_prob + USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_LOC +END PROGRAM c_loc_prob