From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 49545385483A; Tue, 16 May 2023 22:32:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 49545385483A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684276358; bh=8MMYr6AebtqK7N0b8Kk00T4dvKOFJvdjJVtZfAiHqUA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BxWhhoISdQhOVNm018xQJ6IcqT9/v5GppZumnHX2y/yyEMHGpGttz3Z1bReveVENV znJULvbm0fao4TvigQuWRkpfU+4uNEABd53/Iyv0p5Ynzz4ShmYsJnMucPdtl/7/AF L7z3rRFPIPVUR8OLoE9SrGmnSF9RQOpItPkVgAl4= From: "Gary.White at ColoState dot edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109865] different results when routine moved inside the contains statement Date: Tue, 16 May 2023 22:32:38 +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: og12 (devel/omp/gcc-12) X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Gary.White at ColoState dot edu 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109865 --- Comment #11 from GARY.WHITE at ColoState dot edu --- I've never used valgrind -- what would it do? The problem isn't that the code is wrong -- otherwise -O0 would not generate correct results. The compiler is optimizing something incorrectly with -O1 that causes the numerical optimizer, i.e., va09ad code, to not work correct= ly.=20 I included 2 files in the zip file that show incorrect and correct results = -- basically va09ad just doesn't go anywhere, not finding an optimum after run= ning to the maximum number of function calls. It's not blowing up or aborting -- just producing wrong answers. I am willing to walk you through where the critical code is located, but ne= ed to know more of what system you're working on and how I can help.=