From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB4DC3857031; Wed, 1 Jul 2020 12:24:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB4DC3857031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593606283; bh=X/QyIUKG/DrjWayl3NSeUqb4s7kgGBuRT53dNMAsIpU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gnxpolOukD+ONAjSiq0x/woU0PH68lPB+Oe+ynIaOkzK8ZIw1ojPoDIVZx9iMZsIq ksPcL0LvH+xGUm/DpYpdKw+7PO4naxIEliujMXazA6WQb6fuHfRfykYXAUkorR+qAL jL+yJ1aef3TIlLtzVWGRzZ/N0EqiH9YYibB0fijc= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/96018] Optimization issue with external HDF5 library Date: Wed, 01 Jul 2020 12:24:43 +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: anlauf at gcc dot gnu.org 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 12:24:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96018 --- Comment #3 from anlauf at gcc dot gnu.org --- You are not using HDF5's "native" Fortran interface directly, but a clumsy way with c_f_pointer to obscure your code. Any reason for that? Have you considered using RESHAPE for what you seem to try to get? Your code will run into issues if the dummy "array" is not contiguous. Also, I'd consider not checking a library's return code bad style. Also, can you give details on the exact compiler version and HDF5?=