public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34008]  New: ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment
@ 2007-11-06 22:19 anlauf at gmx dot de
  2007-11-06 22:20 ` [Bug fortran/34008] " anlauf at gmx dot de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: anlauf at gmx dot de @ 2007-11-06 22:19 UTC (permalink / raw)
  To: gcc-bugs

Hi,

there's a bug that shows up when overloading elemental assignments.
The attached code sample crashes with:

gfcbug74.f90: In function 'assign_atm_to_atm':
gfcbug74.f90:33: internal compiler error: in gfc_trans_call, at
fortran/trans-stmt.c:389

When replacing the offending line

    y% m = x% m                             ! ICE

by an explicit loop

    do i=1,42; y% m(i) = x% m(i); end do    ! Works

the code compiles.

Cheers,
-ha


-- 
           Summary: ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on
                    elemental assignment
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at gmx dot de
  GCC host triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/34008] ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment
  2007-11-06 22:19 [Bug fortran/34008] New: ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment anlauf at gmx dot de
@ 2007-11-06 22:20 ` anlauf at gmx dot de
  2007-11-07 14:40 ` pault at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gmx dot de @ 2007-11-06 22:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from anlauf at gmx dot de  2007-11-06 22:20 -------
Created an attachment (id=14491)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14491&action=view)
Demo code


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/34008] ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment
  2007-11-06 22:19 [Bug fortran/34008] New: ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment anlauf at gmx dot de
  2007-11-06 22:20 ` [Bug fortran/34008] " anlauf at gmx dot de
@ 2007-11-07 14:40 ` pault at gcc dot gnu dot org
  2007-11-13  8:52 ` dominiq at lps dot ens dot fr
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-11-07 14:40 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/34008] ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment
  2007-11-06 22:19 [Bug fortran/34008] New: ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment anlauf at gmx dot de
  2007-11-06 22:20 ` [Bug fortran/34008] " anlauf at gmx dot de
  2007-11-07 14:40 ` pault at gcc dot gnu dot org
@ 2007-11-13  8:52 ` dominiq at lps dot ens dot fr
  2007-11-14  7:03 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens dot fr @ 2007-11-13  8:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dominiq at lps dot ens dot fr  2007-11-13 08:52 -------
The patch works as advertised without regression on both PPC and Intel Darwin8.


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/34008] ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment
  2007-11-06 22:19 [Bug fortran/34008] New: ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment anlauf at gmx dot de
                   ` (2 preceding siblings ...)
  2007-11-13  8:52 ` dominiq at lps dot ens dot fr
@ 2007-11-14  7:03 ` patchapp at dberlin dot org
  2007-11-16 14:47 ` pault at gcc dot gnu dot org
  2007-11-16 14:49 ` pault at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: patchapp at dberlin dot org @ 2007-11-14  7:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from patchapp at dberlin dot org  2007-11-14 07:03 -------
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


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/34008] ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment
  2007-11-06 22:19 [Bug fortran/34008] New: ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment anlauf at gmx dot de
                   ` (3 preceding siblings ...)
  2007-11-14  7:03 ` patchapp at dberlin dot org
@ 2007-11-16 14:47 ` pault at gcc dot gnu dot org
  2007-11-16 14:49 ` pault at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-11-16 14:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2007-11-16 14:47 -------
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


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/34008] ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment
  2007-11-06 22:19 [Bug fortran/34008] New: ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment anlauf at gmx dot de
                   ` (4 preceding siblings ...)
  2007-11-16 14:47 ` pault at gcc dot gnu dot org
@ 2007-11-16 14:49 ` pault at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-11-16 14:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2007-11-16 14:49 -------
Fixed on trunk

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-11-16 14:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-06 22:19 [Bug fortran/34008] New: ICE in gfc_trans_call, at fortran/trans-stmt.c:389 on elemental assignment anlauf at gmx dot de
2007-11-06 22:20 ` [Bug fortran/34008] " anlauf at gmx dot de
2007-11-07 14:40 ` pault at gcc dot gnu dot org
2007-11-13  8:52 ` dominiq at lps dot ens dot fr
2007-11-14  7:03 ` patchapp at dberlin dot org
2007-11-16 14:47 ` pault at gcc dot gnu dot org
2007-11-16 14:49 ` pault at gcc dot gnu dot 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).