From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14619 invoked by alias); 27 Jan 2012 10:12:30 -0000 Received: (qmail 14608 invoked by uid 22791); 27 Jan 2012 10:12:29 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Jan 2012 10:12:16 +0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52016] New: [OOP] Polymorphism and elemental: missing diagnostic Date: Fri, 27 Jan 2012 10:18:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-01/txt/msg03104.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52016 Bug #: 52016 Summary: [OOP] Polymorphism and elemental: missing diagnostic Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: dominiq@lps.ens.fr This PR is probably a duplicate of pr52013 with a fix before submission (see http://gcc.gnu.org/ml/fortran/2012-01/msg00224.html ;-). While investigating why the test in pr50981 comment #23 was yielding an ICE even with the patch from http://gcc.gnu.org/ml/fortran/2012-01/msg00223.html , I reduced the origin of the ICE to the following test type t integer :: a end type t type(t), allocatable :: var1, var2(:) allocate(var1, var2(2)) call sub_ctae(var2) if (any (var2%a /= 9)) call abort() contains elemental subroutine sub_ctae(y) class(t), intent(inout), optional :: y(:) ! <-- invalid and gives an ICE ! class(t), intent(inout), optional :: y ! <-- valid and works if (present(y)) y%a = 9 if (present(y)) i = 7 end subroutine sub_ctae end which gives pr50981_4_red.f90: In function 'sub_ctae': pr50981_4_red.f90:13:0: internal compiler error: in gfc_conv_descriptor_data_get, at fortran/trans-array.c:147 for an unpatched r183306 and pr50981_4_red.f90: In function 'MAIN__': pr50981_4_red.f90:6:0: internal compiler error: in fold_convert_loc, at fold-const.c:2016 for my patched tree.