public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/55574] New: c binding access to c_ptr type
@ 2012-12-03 14:20 valeryweber at hotmail dot com
2012-12-03 15:06 ` [Bug fortran/55574] " dominiq at lps dot ens.fr
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: valeryweber at hotmail dot com @ 2012-12-03 14:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55574
Bug #: 55574
Summary: c binding access to c_ptr type
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: valeryweber@hotmail.com
Hi All
shouldnt gfortran (gcc version 4.8.0 20121126) complain with the following code
(something like c_ptr not defined)?
v
program aaaa
use iso_c_binding, only : c_loc
integer, target :: i
type(C_PTR) :: f_ptr
f_ptr=c_loc(i)
end program aaaa
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/55574] c binding access to c_ptr type
2012-12-03 14:20 [Bug fortran/55574] New: c binding access to c_ptr type valeryweber at hotmail dot com
@ 2012-12-03 15:06 ` dominiq at lps dot ens.fr
2012-12-03 15:40 ` [Bug fortran/55574] [4.7/4.8 Regression] C " burnus at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-12-03 15:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55574
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-12-03 15:05:45 UTC ---
Up to revision 181424 (4.7.0), compiling the test gives the following error:
pr55574.f90:4.13:
type(C_PTR) :: f_ptr
1
Error: Derived type 'c_ptr' at (1) is being used before it is defined
pr55574.f90:5.8:
f_ptr=c_loc(i)
1
Error: Can't convert TYPE(_gfortran_iso_c_binding_c_ptr) to REAL(4) at (1)
Starting at revision 181425, the test compiles without error.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/55574] [4.7/4.8 Regression] C binding access to c_ptr type
2012-12-03 14:20 [Bug fortran/55574] New: c binding access to c_ptr type valeryweber at hotmail dot com
2012-12-03 15:06 ` [Bug fortran/55574] " dominiq at lps dot ens.fr
@ 2012-12-03 15:40 ` burnus at gcc dot gnu.org
2013-01-15 18:02 ` mikael at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-12-03 15:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55574
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid, diagnostic
Priority|P3 |P4
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-12-03
Target Milestone|--- |4.7.3
Summary|c binding access to c_ptr |[4.7/4.8 Regression] C
|type |binding access to c_ptr
| |type
Ever Confirmed|0 |1
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-12-03 15:39:49 UTC ---
(In reply to comment #1)
> Starting at revision 181425, the test compiles without error.
That's the "constructor" patch (= generic function name might be the same as a
derived-type name) for PR 39427 / PR 37829,
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181425
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/55574] [4.7/4.8 Regression] C binding access to c_ptr type
2012-12-03 14:20 [Bug fortran/55574] New: c binding access to c_ptr type valeryweber at hotmail dot com
2012-12-03 15:06 ` [Bug fortran/55574] " dominiq at lps dot ens.fr
2012-12-03 15:40 ` [Bug fortran/55574] [4.7/4.8 Regression] C " burnus at gcc dot gnu.org
@ 2013-01-15 18:02 ` mikael at gcc dot gnu.org
2013-03-25 15:54 ` [Bug fortran/55574] [4.7/4.8/4.9 " burnus at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-01-15 18:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55574
--- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> 2013-01-15 18:02:07 UTC ---
Created attachment 29173
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29173
Lightly tested patch
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/55574] [4.7/4.8/4.9 Regression] C binding access to c_ptr type
2012-12-03 14:20 [Bug fortran/55574] New: c binding access to c_ptr type valeryweber at hotmail dot com
` (2 preceding siblings ...)
2013-01-15 18:02 ` mikael at gcc dot gnu.org
@ 2013-03-25 15:54 ` burnus at gcc dot gnu.org
2013-04-11 7:59 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-03-25 15:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55574
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-03-25 15:54:31 UTC ---
Author: burnus
Date: Mon Mar 25 15:40:26 2013
New Revision: 197053
URL: http://gcc.gnu.org/viewcvs?rev=197053&root=gcc&view=rev
Log:
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
Added:
trunk/gcc/testsuite/gfortran.dg/blockdata_7.f90
trunk/gcc/testsuite/gfortran.dg/c_assoc_4.f90
trunk/gcc/testsuite/gfortran.dg/c_f_pointer_tests_6.f90
trunk/gcc/testsuite/gfortran.dg/c_f_pointer_tests_7.f90
trunk/gcc/testsuite/gfortran.dg/c_funloc_tests_8.f90
trunk/gcc/testsuite/gfortran.dg/c_loc_test_17.f90
trunk/gcc/testsuite/gfortran.dg/c_loc_test_18.f90
trunk/gcc/testsuite/gfortran.dg/c_loc_test_19.f90
trunk/gcc/testsuite/gfortran.dg/c_loc_test_20.f90
trunk/gcc/testsuite/gfortran.dg/c_loc_tests_17.f90
trunk/gcc/testsuite/gfortran.dg/c_sizeof_5.f90
trunk/gcc/testsuite/gfortran.dg/iso_c_binding_rename_3.f90
trunk/gcc/testsuite/gfortran.dg/transfer_resolve_2.f90
trunk/gcc/testsuite/gfortran.dg/transfer_resolve_3.f90
trunk/gcc/testsuite/gfortran.dg/transfer_resolve_4.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/check.c
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.h
trunk/gcc/fortran/iresolve.c
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/symbol.c
trunk/gcc/fortran/target-memory.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans-intrinsic.c
trunk/gcc/fortran/trans-io.c
trunk/gcc/fortran/trans-types.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/c_assoc_2.f03
trunk/gcc/testsuite/gfortran.dg/c_f_pointer_shape_test.f90
trunk/gcc/testsuite/gfortran.dg/c_f_pointer_shape_tests_3.f03
trunk/gcc/testsuite/gfortran.dg/c_f_pointer_tests_5.f90
trunk/gcc/testsuite/gfortran.dg/c_funloc_tests_2.f03
trunk/gcc/testsuite/gfortran.dg/c_funloc_tests_5.f03
trunk/gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90
trunk/gcc/testsuite/gfortran.dg/c_loc_tests_10.f03
trunk/gcc/testsuite/gfortran.dg/c_loc_tests_11.f03
trunk/gcc/testsuite/gfortran.dg/c_loc_tests_15.f90
trunk/gcc/testsuite/gfortran.dg/c_loc_tests_16.f90
trunk/gcc/testsuite/gfortran.dg/c_loc_tests_3.f03
trunk/gcc/testsuite/gfortran.dg/c_loc_tests_4.f03
trunk/gcc/testsuite/gfortran.dg/c_loc_tests_8.f03
trunk/gcc/testsuite/gfortran.dg/c_ptr_tests_13.f03
trunk/gcc/testsuite/gfortran.dg/c_ptr_tests_14.f90
trunk/gcc/testsuite/gfortran.dg/c_ptr_tests_15.f90
trunk/gcc/testsuite/gfortran.dg/c_ptr_tests_9.f03
trunk/gcc/testsuite/gfortran.dg/c_sizeof_1.f90
trunk/gcc/testsuite/gfortran.dg/iso_c_binding_init_expr.f03
trunk/gcc/testsuite/gfortran.dg/pr32601.f03
trunk/gcc/testsuite/gfortran.dg/pr32601_1.f03
trunk/gcc/testsuite/gfortran.dg/storage_size_2.f08
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/55574] [4.7/4.8/4.9 Regression] C binding access to c_ptr type
2012-12-03 14:20 [Bug fortran/55574] New: c binding access to c_ptr type valeryweber at hotmail dot com
` (3 preceding siblings ...)
2013-03-25 15:54 ` [Bug fortran/55574] [4.7/4.8/4.9 " burnus at gcc dot gnu.org
@ 2013-04-11 7:59 ` rguenth at gcc dot gnu.org
2013-12-21 21:39 ` [Bug fortran/55574] [4.7/4.8 " mikael at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-04-11 7:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55574
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.7.3 |4.7.4
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2013-04-11 07:59:29 UTC ---
GCC 4.7.3 is being released, adjusting target milestone.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/55574] [4.7/4.8 Regression] C binding access to c_ptr type
2012-12-03 14:20 [Bug fortran/55574] New: c binding access to c_ptr type valeryweber at hotmail dot com
` (4 preceding siblings ...)
2013-04-11 7:59 ` rguenth at gcc dot gnu.org
@ 2013-12-21 21:39 ` mikael at gcc dot gnu.org
2014-06-12 13:49 ` rguenth at gcc dot gnu.org
2014-07-11 7:07 ` [Bug fortran/55574] [4.8 " burnus at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-12-21 21:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55574
--- Comment #8 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Paul Thomas from comment #7)
> Tell me, why was your patch never applied?
You answered that question at the next line. ;-)
> As far as I can see, nobody even
> reviewed it - is that right?
>
I believe so. This bug ceased to matter much after it was fixed on mainline.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/55574] [4.7/4.8 Regression] C binding access to c_ptr type
2012-12-03 14:20 [Bug fortran/55574] New: c binding access to c_ptr type valeryweber at hotmail dot com
` (5 preceding siblings ...)
2013-12-21 21:39 ` [Bug fortran/55574] [4.7/4.8 " mikael at gcc dot gnu.org
@ 2014-06-12 13:49 ` rguenth at gcc dot gnu.org
2014-07-11 7:07 ` [Bug fortran/55574] [4.8 " burnus at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-12 13:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55574
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.7.4 |4.8.4
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
The 4.7 branch is being closed, moving target milestone to 4.8.4.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/55574] [4.8 Regression] C binding access to c_ptr type
2012-12-03 14:20 [Bug fortran/55574] New: c binding access to c_ptr type valeryweber at hotmail dot com
` (6 preceding siblings ...)
2014-06-12 13:49 ` rguenth at gcc dot gnu.org
@ 2014-07-11 7:07 ` burnus at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-07-11 7:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55574
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> ---
As the current patch is rather intrusive and as the issue is fixed in the
released compiler 4.9.0, it is unlikely that the fix is backported to GCC 4.8.
Hence:
- WON'T FIX for GCC 4.8.
- FIXED for GCC 4.9/4.10.
Thanks for the report, the patience and sorry that it won't get fixed in GCC
4.7/4.8 any more.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-07-11 7:07 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-03 14:20 [Bug fortran/55574] New: c binding access to c_ptr type valeryweber at hotmail dot com
2012-12-03 15:06 ` [Bug fortran/55574] " dominiq at lps dot ens.fr
2012-12-03 15:40 ` [Bug fortran/55574] [4.7/4.8 Regression] C " burnus at gcc dot gnu.org
2013-01-15 18:02 ` mikael at gcc dot gnu.org
2013-03-25 15:54 ` [Bug fortran/55574] [4.7/4.8/4.9 " burnus at gcc dot gnu.org
2013-04-11 7:59 ` rguenth at gcc dot gnu.org
2013-12-21 21:39 ` [Bug fortran/55574] [4.7/4.8 " mikael at gcc dot gnu.org
2014-06-12 13:49 ` rguenth at gcc dot gnu.org
2014-07-11 7:07 ` [Bug fortran/55574] [4.8 " burnus at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).