From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11237 invoked by alias); 20 Nov 2013 05:43:46 -0000 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 Received: (qmail 11220 invoked by uid 48); 20 Nov 2013 05:43:41 -0000 From: "octoploid at yandex dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/59201] New: [4.9 Regression] error: stmt (0x7f01c4708130) marked modified after optimization pass Date: Wed, 20 Nov 2013 05:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: octoploid at yandex dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg01942.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59201 Bug ID: 59201 Summary: [4.9 Regression] error: stmt (0x7f01c4708130) marked modified after optimization pass Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: octoploid at yandex dot com markus@x4 src % cat test.ii class A { public: virtual void m_fn1(); }; class B final : A { ~B(); virtual void m_fn2() { m_fn1(); } }; B::~B() {} markus@x4 src % g++ -c -std=3Dc++11 -O2 test.ii test.ii: In member function =E2=80=98virtual void B::m_fn2()=E2=80=99: test.ii:7:16: error: stmt (0x7f96e3a9e130) marked modified after optimizati= on pass:=20 virtual void m_fn2() { m_fn1(); } ^ # .MEM_6 =3D VDEF <.MEM_2(D)> A::m_fn1 (_5); test.ii:7:16: internal compiler error: verify_ssa failed 0xcc71df verify_ssa(bool) ../../gcc/gcc/tree-ssa.c:1092 0xa7fffc execute_function_todo ../../gcc/gcc/passes.c:1842 0xa80883 execute_todo ../../gcc/gcc/passes.c:1875 0xa826f1 execute_one_ipa_transform_pass ../../gcc/gcc/passes.c:2060 0xa826f1 execute_all_ipa_transforms() ../../gcc/gcc/passes.c:2091 0x822eb0 expand_function ../../gcc/gcc/cgraphunit.c:1753 0x824fe7 expand_all_functions ../../gcc/gcc/cgraphunit.c:1865 0x824fe7 compile() ../../gcc/gcc/cgraphunit.c:2199 0x825504 finalize_compilation_unit() ../../gcc/gcc/cgraphunit.c:2276 0x6217ae cp_write_global_declarations() ../../gcc/gcc/cp/decl2.c:4408 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. markus@x4 src % >>From gcc-bugs-return-435166-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Nov 20 06:03:38 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 814 invoked by alias); 20 Nov 2013 06:03:37 -0000 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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 749 invoked by uid 48); 20 Nov 2013 06:03:34 -0000 From: "ian_harvey at bigpond dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/59202] New: Erroneous argument aliasing with defined assignment Date: Wed, 20 Nov 2013 06:03: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-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ian_harvey at bigpond dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg01943.txt.bz2 Content-length: 2300 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59202 Bug ID: 59202 Summary: Erroneous argument aliasing with defined assignment Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: ian_harvey at bigpond dot com gfortran build from very recent trunk does not appear to be correctly handling the case when an object with allocatable components is self assigned and defined assignment is accessible. For example: MODULE DefinedAssignmentModule IMPLICIT NONE TYPE :: t INTEGER, ALLOCATABLE :: array(:) END TYPE t INTERFACE ASSIGNMENT(=) MODULE PROCEDURE def_assign END INTERFACE ASSIGNMENT(=) CONTAINS SUBROUTINE def_assign(lhs, rhs) TYPE(t), INTENT(OUT) :: lhs ! Investigate INOUT too. TYPE(t), INTENT(IN) :: rhs !***** ! Allocation status of lhs and rhs on entry. PRINT "(*(L1,:,1X))", ALLOCATED(lhs%array), ALLOCATED(rhs%array) ! Change allocation status of lhs IF (ALLOCATED(lhs%array)) DEALLOCATE(lhs%array) ALLOCATE(lhs%array(5)) ! Resulting allocation status of lhs and rhs. PRINT "(1X,*(L1,:,1X))", ALLOCATED(lhs%array), ALLOCATED(rhs%array) END SUBROUTINE def_assign SUBROUTINE reset(obj) TYPE(t), INTENT(OUT) :: obj END SUBROUTINE reset END MODULE DefinedAssignmentModule PROGRAM DefinedAssignmentTest USE DefinedAssignmentModule IMPLICIT NONE TYPE(t) :: a ! This... a = a CALL reset(a) ! ...should be equivalent to this... CALL def_assign(a, (a)) CALL reset(a) ALLOCATE(a%array(2)) a = a ! rhs should be allocated on entry. END PROGRAM DefinedAssignmentTest results in: F F T T F F T F F F T T The first two lines indicate that changes to lhs inside the procedure result in changes to rhs (even though rhs is equivalent to the the value of a parenthesised expression per F2008 12.4.3.4.3 - hence the two arguments are not aliased). The third and fourth lines indicate that the compiler is correctly handling explicit passing of a parenthesised expression. The fifth and sixth lines indicate that application of INTENT(OUT) to lhs is affecting rhs on entry to the procedure.