------- Comment #2 from burnus at gcc dot gnu dot org  2010-07-08 09:21 -------
Joe, as work around you can do the following: splitting the single USE
statement into multiple:

  use ISO_C_Binding, only: C_ptr
  use ISO_C_Binding, only: C_char_ptr=>C_ptr


 * * *

I think there are two (three) bugs:

(a) without only, one needs to move the generation into the inner loop and
remove the "break" - though, if no variable was found in the rename list, it
needs still be created (i.e. the symbol creation should also be after the
loop).

(b) For "ONLY:", the code "sort_iso_c_rename_list" in module.c is wrong: It
assumes that there can be only one rename ...
Maybe, it is the simplest to merge "only" and not-"only" and simply add
"if (!found && !only)" after the inner rename loop; then,
sort_iso_c_rename_list can also be removed.

(c) Without only flag, ISO_Fortran_ENV has the same problem (cf. a) - it works
with ONLY. The solution is again to move the creation into the loop. But as
there are many checks, an auxiliary function should probably be used.
Failing example:

use iso_fortran_env, one => ERROR_UNIT, &  ! Works with "only"
                     two => ERROR_UNIT
implicit none
if (one /= two) error stop 'Something is fishy'
end


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44702

Reply via email to