[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
--- Comment #9 from janus at gcc dot gnu dot org 2009-06-16 09:06 --- Subject: Bug 36947 Author: janus Date: Tue Jun 16 09:06:13 2009 New Revision: 148519 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=148519 Log: 2009-06-16 Janus Weil ja...@gcc.gnu.org PR fortran/36947 PR fortran/40039 * expr.c (gfc_check_pointer_assign): Call 'gfc_compare_interfaces' with error message. * gfortran.h (gfc_compare_interfaces): Additional argument. * interface.c (operator_correspondence): Removed. (gfc_compare_interfaces): Additional argument to return error message. Directly use the code from 'operator_correspondence' instead of calling the function. Check for OPTIONAL. Some rearrangements. (check_interface1): Call 'gfc_compare_interfaces' without error message. (compare_parameter): Call 'gfc_compare_interfaces' with error message. * resolve.c (check_generic_tbp_ambiguity): Call 'gfc_compare_interfaces' without error message. 2009-06-16 Janus Weil ja...@gcc.gnu.org PR fortran/36947 PR fortran/40039 * gfortran.dg/dummy_procedure_1.f90: Extended test case. * gfortran.dg/interface_20.f90: Modified error messages. * gfortran.dg/interface_21.f90: Ditto. * gfortran.dg/interface_26.f90: Ditto. * gfortran.dg/interface_27.f90: Ditto. * gfortran.dg/interface_28.f90: Extended test case. * gfortran.dg/interface_29.f90: New. * gfortran.dg/proc_decl_7.f90: Modified error messages. * gfortran.dg/proc_decl_8.f90: Ditto. * gfortran.dg/proc_ptr_11.f90: Ditto. * gfortran.dg/proc_ptr_15.f90: Ditto. Added: trunk/gcc/testsuite/gfortran.dg/interface_29.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/expr.c trunk/gcc/fortran/gfortran.h trunk/gcc/fortran/interface.c trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/dummy_procedure_1.f90 trunk/gcc/testsuite/gfortran.dg/interface_20.f90 trunk/gcc/testsuite/gfortran.dg/interface_21.f90 trunk/gcc/testsuite/gfortran.dg/interface_26.f90 trunk/gcc/testsuite/gfortran.dg/interface_27.f90 trunk/gcc/testsuite/gfortran.dg/interface_28.f90 trunk/gcc/testsuite/gfortran.dg/proc_decl_7.f90 trunk/gcc/testsuite/gfortran.dg/proc_decl_8.f90 trunk/gcc/testsuite/gfortran.dg/proc_ptr_11.f90 trunk/gcc/testsuite/gfortran.dg/proc_ptr_15.f90 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
--- Comment #10 from janus at gcc dot gnu dot org 2009-06-16 09:14 --- From the ToDo items in comment #7, r148519 fixes the first two (check for optional and better error messages). The remaining item (recursive check) is tracked by PR 40453, so I think this PR can be closed. -- janus at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
-- janus at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |janus at gcc dot gnu dot org |dot org | Status|NEW |ASSIGNED Last reconfirmed|2009-03-29 08:26:27 |2009-06-12 20:50:39 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
--- Comment #6 from janus at gcc dot gnu dot org 2009-05-18 09:19 --- Subject: Bug 36947 Author: janus Date: Mon May 18 09:19:20 2009 New Revision: 147655 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=147655 Log: 2009-05-18 Janus Weil ja...@gcc.gnu.org PR fortran/36947 PR fortran/40039 * expr.c (gfc_check_pointer_assign): Check intents when comparing interfaces. * gfortran.h (typedef struct gfc_intrinsic_arg): Add 'intent' member. (gfc_compare_interfaces): Additional argument. * interface.c (operator_correspondence): Add check for equality of intents, and new argument 'intent_check'. (gfc_compare_interfaces): New argument 'intent_check', which is passed on to operator_correspondence. (check_interface1): Don't check intents when comparing interfaces. (compare_parameter): Do check intents when comparing interfaces. * intrinsic.c (add_sym): Add intents for arguments of intrinsic procedures. (add_sym_1,add_sym_1s,add_sym_1m,add_sym_2,add_sym_2s,add_sym_3, add_sym_3ml,add_sym_3red,add_sym_3s,add_sym_4): Use INTENT_IN by default. (add_sym_1_intent,add_sym_1s_intent,add_sym_2s_intent,add_sym_3s_intent) : New functions to add intrinsic symbols, specifying custom intents. (add_sym_4s,add_sym_5s): Add new arguments to specify intents. (add_functions,add_subroutines): Add intents for various intrinsics. * resolve.c (check_generic_tbp_ambiguity): Don't check intents when comparing interfaces. * symbol.c (gfc_copy_formal_args_intr): Copy intent. 2009-05-18 Janus Weil ja...@gcc.gnu.org PR fortran/36947 PR fortran/40039 * gfortran.dg/interface_27.f90: New. * gfortran.dg/interface_28.f90: New. * gfortran.dg/proc_ptr_11.f90: Fixing invalid test case. * gfortran.dg/proc_ptr_result_1.f90: Ditto. Added: trunk/gcc/testsuite/gfortran.dg/interface_27.f90 trunk/gcc/testsuite/gfortran.dg/interface_28.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/expr.c trunk/gcc/fortran/gfortran.h trunk/gcc/fortran/interface.c trunk/gcc/fortran/intrinsic.c trunk/gcc/fortran/resolve.c trunk/gcc/fortran/symbol.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/proc_ptr_11.f90 trunk/gcc/testsuite/gfortran.dg/proc_ptr_result_1.f90 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
--- Comment #7 from janus at gcc dot gnu dot org 2009-05-18 09:36 --- The commit in comment #6 implements the checking for intents. ToDo: * check for OPTIONAL * better error messages * recursive check (see comment #2) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
--- Comment #8 from w6ws at earthlink dot net 2009-05-18 15:36 --- Subject: Re: Attributes not fully checked comparing actual vs dummy procedure Janus, janus at gcc dot gnu dot org wrote: --- Comment #7 from janus at gcc dot gnu dot org 2009-05-18 09:36 --- The commit in comment #6 implements the checking for intents. ToDo: * check for OPTIONAL * better error messages * recursive check (see comment #2) I was going to comment that OPTIONAL should be checked too, but you beat me to it. We have been having problems with both OPTIONAL and INTENT not being checked by various compilers. NAG, of course, does a better job than most in this area. It is good to see gfortran learn about this checking too. Thank you for your hard work on this! Walter -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
-- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-03-29 08:26:27 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
--- Comment #4 from alex at ozo dot com 2008-08-03 08:33 --- trying to compile ath9k for mips or mipsel under openwrt toolchain with gcc-4.2.4 produces the following error: make[3]: Entering directory `/extra3/openwrt/ar71xx/trunk/package/ath9k' make -C /extra3/openwrt/ar71xx/trunk/build_dir/linux-ar71xx/linux-2.6.26 ARCH=mips CROSS_COMPILE=mips-linux-uclibc- SUBDIRS=/extra3/openwrt/ar71xx/trunk/build_dir/linux-ar71xx/ath9k-20080731/drivers/net/wireless/ath9k EXTRA_CFLAGS= -DCONFIG_ATH9K=1 LINUXINCLUDE=-I/extra3/openwrt/ar71xx/trunk/staging_dir/mips/usr/include/mac80211 -I/extra3/openwrt/ar71xx/trunk/build_dir/linux-ar71xx/linux-2.6.26/include -include linux/autoconf.h CONFIG_ATH9K=m modules make[4]: Entering directory `/extra3/openwrt/ar71xx/trunk/build_dir/linux-ar71xx/linux-2.6.26' CC [M] /extra3/openwrt/ar71xx/trunk/build_dir/linux-ar71xx/ath9k-20080731/drivers/net/wireless/ath9k/hw.o /extra3/openwrt/ar71xx/trunk/build_dir/linux-ar71xx/ath9k-20080731/drivers/net/wireless/ath9k/hw.c: In function 'ath9k_hw_spur_mitigate': /extra3/openwrt/ar71xx/trunk/build_dir/linux-ar71xx/ath9k-20080731/drivers/net/wireless/ath9k/hw.c:4906: internal compiler error: in expand_expr_real_1, at expr.c:8760 Please submit a full bug report, with preprocessed source if appropriate. a snapshot of the ath9k used is here: http://wifi.ozo.com/airo/openwrt/source/ath9k a relative ticket on the ath9k is here: https://lists.ath9k.org/pipermail/ath9k-devel/2008-August/82.html gcc-3.4.6 compiles fine for mips mipsel targets. gcc-4.2.4 also compiles fine for x86 target. -- alex at ozo dot com changed: What|Removed |Added CC||alex at ozo dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
--- Comment #5 from alex at ozo dot com 2008-08-03 08:43 --- please discard the above entry and accept my apologies as this is my first attempt to report a bug issue using bugzilla. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
--- Comment #2 from burnus at gcc dot gnu dot org 2008-07-27 07:23 --- Currently, in interface.c's compare_parameter the checking is done via compare_interfaces. However, this function is used to check for problems with generic interfaces and from that point of view the two procedures are not distinguishable. One way is to check is to add a loop as else branch and to check there for INTENT and OPTIONAL of each argument. This also allows for a better error message than the Type/rank mismatch in argument. If actual-argument procedure itself takes procedures as argument, one can check recursively, which will be more work; I think for such kind of nesting no checking is done currently. (I thought that there was a PR already, but I cannot find it - maybe it does not exist.) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
--- Comment #3 from w6ws at earthlink dot net 2008-07-27 13:52 --- Subject: Re: Attributes not fully checked comparing actual vs dummy procedure burnus at gcc dot gnu dot org wrote: If actual-argument procedure itself takes procedures as argument, one can check recursively, which will be more work; I think for such kind of nesting no checking is done currently. Good point. (I thought that there was a PR already, but I cannot find it - maybe it does not exist.) There are several 'accept-invalid' PRs that seem to deal with similar issues, but I did not see any that specifically addressed this one. BTW, I meant to say that the NAG compiler finds the problem at *compile* time. So run-time never happens. Almost every other compiler I have tried ignores the problem, and a SEGV usually occurs at run-time. Thank you for looking into this! W. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947
[Bug fortran/36947] Attributes not fully checked comparing actual vs dummy procedure
--- Comment #1 from w6ws at earthlink dot net 2008-07-27 04:22 --- Fixed summary and keyword fields -- w6ws at earthlink dot net changed: What|Removed |Added GCC build triplet|Attributes not fully checked| |comparing actual vs dummy | |procedure | Keywords||accepts-invalid Summary|accepts-invalid |Attributes not fully checked ||comparing actual vs dummy ||procedure http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36947