This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/34008] ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment



------- Comment #2 from pault at gcc dot gnu dot org  2007-11-07 14:39 -------
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


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-07 14:39:48
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]