Summary: | ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment | ||
---|---|---|---|
Product: | gcc | Reporter: | Harald Anlauf <anlauf> |
Component: | fortran | Assignee: | Paul Thomas <pault> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs |
Priority: | P3 | ||
Version: | 4.3.0 | ||
Target Milestone: | --- | ||
Host: | i686-pc-linux-gnu | Target: | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2007-11-07 14:39:48 | |
Bug Depends on: | |||
Bug Blocks: | 32834 | ||
Attachments: | Demo code |
Description
Harald Anlauf
2007-11-06 22:19:40 UTC
Created attachment 14491 [details]
Demo code
According to 12.3.2.1.2 Defined assignments If ASSIGNMENT is specified in an INTERFACE statement, all the procedures in the interface block shall be subroutines that may be referenced as defined assignments (7.5.1.3). Each of these subroutines shall have exactly two dummy arguments. Each argument shall be nonoptional. The first argument shall have INTENT (OUT) or INTENT (INOUT)......... gfortran is asserting INTENT (OUT) and not allowing INOUT. I'll fix it this weekend. Paul PS This is the fix: Index: /svn/trunk/gcc/fortran/trans-stmt.c =================================================================== *** /svn/trunk/gcc/fortran/trans-stmt.c (revision 129882) --- /svn/trunk/gcc/fortran/trans-stmt.c (working copy) *************** gfc_trans_call (gfc_code * code, bool de *** 386,392 **** { gfc_symbol *sym; sym = code->resolved_sym; ! gcc_assert (sym->formal->sym->attr.intent == INTENT_OUT); gcc_assert (sym->formal->next->sym->attr.intent == INTENT_IN); gfc_conv_elemental_dependencies (&se, &loopse, sym, code->ext.actual); --- 386,393 ---- { gfc_symbol *sym; sym = code->resolved_sym; ! gcc_assert (sym->formal->sym->attr.intent == INTENT_OUT ! || sym->formal->sym->attr.intent == INTENT_INOUT); gcc_assert (sym->formal->next->sym->attr.intent == INTENT_IN); gfc_conv_elemental_dependencies (&se, &loopse, sym, code->ext.actual); It might be better to remove the assertions and replace them with errors in resolve.c The patch works as advertised without regression on both PPC and Intel Darwin8. Subject: Bug number PR34008 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00769.html Subject: Bug 34008 Author: pault Date: Fri Nov 16 14:47:31 2007 New Revision: 130232 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130232 Log: 2007-11-16 Paul Thomas <pault@gcc.gnu.org> PR fortran/34008 * trans-stmt.c (gfc_conv_elemental_dependencies): Add check for INTENT_INOUT as well as INTENT_OUT. (gfc_trans_call): Remove redundant gcc_asserts in dependency check. 2007-11-16 Paul Thomas <pault@gcc.gnu.org> PR fortran/34008 * gfortran.dg/interface_assignment_3.f90. Added: trunk/gcc/testsuite/gfortran.dg/interface_assignment_3.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-stmt.c trunk/gcc/testsuite/ChangeLog Fixed on trunk Paul |