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/31205] New: wrong code generated with gfortran


With a recent gfortran, the following compiles, but generates the wrong
results:

MODULE TT
 TYPE data_type
   INTEGER :: I=2
 END TYPE data_type
 INTERFACE ASSIGNMENT (=)
   MODULE PROCEDURE set
 END INTERFACE
CONTAINS
  PURE SUBROUTINE set(x1,x2)
    TYPE(data_type), INTENT(IN) :: x2
    TYPE(data_type), INTENT(OUT) :: x1
    CALL S1(x1,x2)
  END SUBROUTINE
  PURE SUBROUTINE S1(x1,x2)
    TYPE(data_type), INTENT(IN) :: x2
    TYPE(data_type), INTENT(OUT) :: x1
    x1%i=x2%i
  END SUBROUTINE
END MODULE

USE TT
TYPE(data_type) :: D,E

D%I=4
D=D

E%I=4
CALL set(E,(E))

IF (D%I.NE.4) CALL ABORT()
IF (4.NE.E%I) CALL ABORT()
END


-- 
           Summary: wrong code generated with gfortran
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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