public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/96018] New: Optimization issue with external HDF5 library
@ 2020-07-01 11:39 martin.schlipf at damnthespam dot com
  2020-07-01 12:01 ` [Bug fortran/96018] " dominiq at lps dot ens.fr
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: martin.schlipf at damnthespam dot com @ 2020-07-01 11:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96018

            Bug ID: 96018
           Summary: Optimization issue with external HDF5 library
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: martin.schlipf at damnthespam dot com
  Target Milestone: ---

Created attachment 48817
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48817&action=edit
Minimal example to demonstrate the issue.

On a clean Ubuntu 20.04 with the following setup

sudo apt-get update
sudo apt-get install gfortran-10
sudo apt-get install libhdf5-dev

the attached code produces an error when compiled with optimization

gfortran-10 -O2 hdf5_bug.f90 -I/usr/include/hdf5/serial/
-L/usr/lib/x86_64-linux-gnu/ -lhdf5_serial_fortran

As far as I can tell, the reason this appears is that the compiler fails to
recognize that the function call in line 98 has side effects and optimizes it
away. If you check the status of the error code, the issue disappears.
Strangely, the exact same sequence of calls with a 2d array instead of a 3d one
works fine.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-07-23 18:28 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 11:39 [Bug fortran/96018] New: Optimization issue with external HDF5 library martin.schlipf at damnthespam dot com
2020-07-01 12:01 ` [Bug fortran/96018] " dominiq at lps dot ens.fr
2020-07-01 12:07 ` martin.schlipf at damnthespam dot com
2020-07-01 12:24 ` anlauf at gcc dot gnu.org
2020-07-01 13:03 ` martin.schlipf at damnthespam dot com
2020-07-01 19:31 ` anlauf at gcc dot gnu.org
2020-07-02  6:49 ` martin.schlipf at damnthespam dot com
2020-07-03  6:10 ` tkoenig at gcc dot gnu.org
2020-07-05 17:54 ` tkoenig at gcc dot gnu.org
2020-07-06 11:39 ` martin.schlipf at damnthespam dot com
2020-07-06 13:31 ` [Bug fortran/96018] [9/10/11 Regression] " dominiq at lps dot ens.fr
2020-07-06 14:24 ` rguenth at gcc dot gnu.org
2020-07-06 15:01 ` tkoenig at gcc dot gnu.org
2020-07-06 15:17 ` tkoenig at gcc dot gnu.org
2020-07-09 20:52 ` tkoenig at gcc dot gnu.org
2020-07-12  9:34 ` tkoenig at gcc dot gnu.org
2020-07-19 11:00 ` cvs-commit at gcc dot gnu.org
2020-07-23 15:56 ` cvs-commit at gcc dot gnu.org
2020-07-23 18:27 ` cvs-commit at gcc dot gnu.org
2020-07-23 18:28 ` tkoenig at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).