From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9492F3892454; Wed, 3 Feb 2021 19:10:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9492F3892454 From: "dcb314 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/98904] valgrind error in gfc_trans_assignment_1 during bootstrap Date: Wed, 03 Feb 2021 19:10:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: dcb314 at hotmail dot com X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: 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: Message-ID: In-Reply-To: References: 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-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 19:10:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98904 --- Comment #12 from David Binderman --- (In reply to Tobias Burnus from comment #11) > It might be that some code optimizes converts ... > It might be that the either the middle end of GCC does this optimization = or > that valgrind does this internally. I don't understand very much of your reply, but if you can replace your two mights with facts, that would be IMHO a step in the right directio= n. I replaced my existing fprintf code with slightly better code on the obvious conditional: if (flag_coarray =3D=3D GFC_FCOARRAY_LIB) { fprintf( stderr, "flag_coarray %d\n", flag_coarray); fprintf( stderr, "lhs_caf_attr.codimension %d\n", lhs_caf_attr.codimension); fprintf( stderr, "rhs_caf_attr.codimension %d\n", rhs_caf_attr.codimension); fprintf( stderr, "lhs_caf_attr.allocatable %d\n", lhs_caf_attr.allocatable); fprintf( stderr, "lhs_refs_comp %d\n", lhs_refs_comp); fprintf( stderr, "rhs_caf_attr.allocatable %d\n", rhs_caf_attr.allocatable); fprintf( stderr, "rhs_refs_comp %d\n", rhs_refs_comp); } and, surprisingly, the problem seems to have gone away. Mind you, I did compile with -O2 this time, not -O3 as originally specified= ,=20 so it looks like I get dodgy results if I build the fortran compiler with -= O3.=20 I will avoid this in future. Deeper minds might want to look into this prob= lem some more.=