This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52029] New: [OOP] _copy should be PURE
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 28 Jan 2012 17:18:58 +0000
- Subject: [Bug fortran/52029] New: [OOP] _copy should be PURE
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52029
Bug #: 52029
Summary: [OOP] _copy should be PURE
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: missed-optimization, rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
The _copy procedure should be PURE.
First, it is pure (which should help with optimization).
Secondly, it avoids an error for:
! Contained procedure '__copy_foo_T' of a PURE procedure must also be PURE
elemental subroutine foo()
type t
end type t
class(t), allocatable :: x
if (allocated(x)) i = 5
end
Draft patch:
--- class.c (Revision 183667)
+++ class.c
@@ -717,0 +718 @@ gfc_find_derived_vtab (gfc_symbol *deriv
+ copy->attr.pure = 1;