From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 04B673857007; Wed, 1 Jul 2020 13:03:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04B673857007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593608620; bh=uzFj/nUku9snN49zSwm9k3WnJYHt30a9B+cq55fUACA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=apbjXLYwaLvRWsbMb0tmOn6epcNxOtNhT2Hv8sMoeJqtaHtsQYc/w/JapSxyMxzUw +z9kwaOzk4idL1CSbwSaTLVM7Em6YOnYlrmjnZFXUHXfpRv7bSQ989RivrHoEoGOsG wf0y8X+KFE1kZZh+ikulYFgnVC+TdvN1b8JYuodo= From: "martin.schlipf at damnthespam dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/96018] Optimization issue with external HDF5 library Date: Wed, 01 Jul 2020 13:03:39 +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: 10.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: martin.schlipf at damnthespam 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, 01 Jul 2020 13:03:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96018 --- Comment #4 from martin.schlipf at damnthespam dot com --- Hdf5 doesn't have native support for complex datatypes, so we convert to re= al and write that it is a complex as an attribute. If you replace the conversi= on logic by an array instead of a pointer allocate(real_array(2,size(array,1),size(array,2),size(array,3))) reshape(transfer(array, real_array), shape(real_array)) it doesn't alert the behavior. I agree that the error code should be checked and in fact, I already starte= d a merge request for that particular part. But for this bug report, I need to leave it away, because otherwise the compiler does the right thing. Finally, I reproduced it with gfortran 9.3.0 + hdf 1.12.0 and gfortran 10.0= + hdf 1.10.4. With older versions of gfortran 7.3.0 it does not appear.=