[Bug fortran/40568] F2008: C_SIZEOF is in the wrong scope, rejected as initialization expression
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40568 --- Comment #6 from Tobias Burnus burnus at gcc dot gnu.org 2010-09-26 22:30:52 UTC --- Author: burnus Date: Sun Sep 26 22:30:48 2010 New Revision: 164639 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=164639 Log: 2010-09-27 Tobias Burnus bur...@net-b.de PR fortran/40569 PR fortran/40568 * intrinsic.h (gfc_simplify_compiler_options, gfc_simplify_compiler_version): New prototypes. * intrinsic.c (gfc_intrinsic_function_by_id, make_from_module): New functions. (gfc_find_function, gfc_find_subroutine, gfc_generic_intrinsic, gfc_specific_intrinsic): Don't return module intrinsics. (add_functions): Add compiler_options, compiler_version. (gfc_intrinsic_func_interface): Also lookup symbol by ISYM ID. * symbol.c (std_for_isocbinding_symbol): Add version check for NAMED_FUNCTIONS. * iso-fortran-env.def: Add compiler_options, compiler_version. * iso-c-binding.def: Add c_sizeof. * gfortran.h (gfc_intrinsic_sym): Add from_module:1. (iso_c_binding_symbol, iso_fortran_env_symbol): Add NAMED_FUNCTIONS. (gfc_intrinsic_function_by_id): New prototype. * module.c (create_intrinsic_function): New function. (import_iso_c_binding_module, use_iso_fortran_env_module): Use it. * trans-types.c (init_c_interop_kinds): Add NAMED_FUNCTIONS. * resolve.c (resolve_intrinsic): Try also to resolve intrinsics by ISYM ID. * simplify.c (gfc_simplify_compiler_options, gfc_simplify_compiler_version): New functions. 2010-09-27 Tobias Burnus bur...@net-b.de PR fortran/40569 PR fortran/40568 * gfortran.dg/storage_size_2.f08: Fix test. * gfortran.dg/c_sizeof_1.f90: Fix test. * gfortran.dg/c_sizeof_2.f90: Update dg-error. * gfortran.dg/c_sizeof_3.f90: New. * gfortran.dg/c_sizeof_4.f90: New. * gfortran.dg/iso_c_binding_compiler_1.f90: New. * gfortran.dg/iso_c_binding_compiler_2.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/c_sizeof_3.f90 trunk/gcc/testsuite/gfortran.dg/c_sizeof_4.f90 trunk/gcc/testsuite/gfortran.dg/iso_c_binding_compiler_1.f90 trunk/gcc/testsuite/gfortran.dg/iso_c_binding_compiler_2.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/gfortran.h trunk/gcc/fortran/intrinsic.c trunk/gcc/fortran/intrinsic.h trunk/gcc/fortran/iso-c-binding.def trunk/gcc/fortran/iso-fortran-env.def trunk/gcc/fortran/module.c trunk/gcc/fortran/resolve.c trunk/gcc/fortran/simplify.c trunk/gcc/fortran/symbol.c trunk/gcc/fortran/trans-types.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/c_sizeof_1.f90 trunk/gcc/testsuite/gfortran.dg/c_sizeof_2.f90 trunk/gcc/testsuite/gfortran.dg/storage_size_2.f08
[Bug fortran/40568] F2008: C_SIZEOF is in the wrong scope, rejected as initialization expression
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40568 --- Comment #5 from Tobias Burnus burnus at gcc dot gnu.org 2010-09-25 22:42:38 UTC --- Patch for the issue in comment 0: http://gcc.gnu.org/ml/fortran/2010-09/msg00455.html TODO: Issue mentioned in comment 1: C_SIZEOF in init expressions.
[Bug fortran/40568] F2008: C_SIZEOF is in the wrong scope, rejected as initialization expression
--- Comment #4 from burnus at gcc dot gnu dot org 2010-06-23 16:45 --- Cf. PR 40569 for two other module procedures of ISO_C_BINDING -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40568
[Bug fortran/40568] F2008: C_SIZEOF is in the wrong scope, rejected as initialization expression
--- Comment #3 from dfranke at gcc dot gnu dot org 2010-05-09 18:11 --- Created an attachment (id=20612) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20612action=view) first steps to bring C_SIZEOF to the ISO_C_BINDING Attached patch is a start only. Comments: * symbol.c (build_formal_args): wrong parameter generated, probably needs a new gen_*_param function * on -std=f2003 there's only a linker error (undefined reference), no F2008-only warning * simplification/translation needs to be hijacked from sizeof -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40568
[Bug fortran/40568] F2008: C_SIZEOF is in the wrong scope, rejected as initialization expression
--- Comment #2 from dfranke at gcc dot gnu dot org 2010-05-02 15:21 --- See also PR36437. -- dfranke at gcc dot gnu dot org changed: What|Removed |Added OtherBugsDependingO||32630 nThis|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40568
[Bug fortran/40568] F2008: C_SIZEOF is in the wrong scope, rejected as initialization expression
--- Comment #1 from dfranke at gcc dot gnu dot org 2009-12-13 16:19 --- F2008 allows C_SIZEOF in initialization expressions: The definition for specification inquiry is in Fortran 2008 (7.1.11 Specification expression): A specication inquiry is a reference to (1) an intrinsic inquiry function, [...] (4) the function C_SIZEOF from the intrinsic module ISO C BINDING (15.2.3.7) Currently C_SIZEOF is rejected as init expression as it is not listed as valid inquiry function, neither is CLASS_INQUIRY in intrinsic.c(add_functions) set. -- dfranke at gcc dot gnu dot org changed: What|Removed |Added CC||dfranke at gcc dot gnu dot ||org OtherBugsDependingO||29962, 39627 nThis|| Summary|F2008: C_SIZEOF is in the |F2008: C_SIZEOF is in the |wrong scope |wrong scope, rejected as ||initialization expression http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40568