public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/110842] New: [14 Regression] Openmp loops with KIND=16 DO loops
@ 2023-07-28 10:49 tkoenig at gcc dot gnu.org
  2023-07-28 10:55 ` [Bug libgomp/110842] " tkoenig at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2023-07-28 10:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110842
           Summary: [14 Regression] Openmp loops with KIND=16 DO loops
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

gfortran with a reasonably current trunk gives wrong
results for omp parallel:

$ cat dynamic.f90 
program main
  implicit none
  integer(kind=16) :: i, anfang, ende, delta
  anfang = 0
  ende = 2**10
  delta = 2**6
  !$omp parallel do default(private) schedule(dynamic,1)
  do i=anfang, ende, delta
     !$omp critical
     print *,i
     !$omp end critical
  end do
end program main
$ gfortran dynamic.f90 
$ ./a.out
                                        0
                                       64
                                      128
                                      192
                                      256
                                      320
                                      384
                                      448
                                      512
                                      576
                                      640
                                      704
                                      768
                                      832
                                      896
                                      960
                                     1024

Without openmp, no problem.

With openmp, some values are garbage:

$ gfortran -fopenmp dynamic.f90 
$ ./a.out
       2584020860371700504877596135129104
                                      768
                                      192
                                      704
                                      960
                                      128
                                      896
                                       64
       2584020860371700504877596135130128
                                      384
                                      448
                                      576
                                      640
                                      320
                                      512
                                      256
                                      832
$ gfortran -v
Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/ig25/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Ziel: x86_64-pc-linux-gnu
Konfiguriert mit: ../trunk/configure --prefix=/home/ig25
--enable-languages=c,c++,fortran --disable-multilib
Thread-Modell: posix
Unterstützte LTO-Kompressionsalgorithmen: zlib
gcc-Version 14.0.0 20230722 (experimental) [master r14-2725-g73cc6ce1294] (GCC) 

System compiler works fine:

$ /usr/bin/gfortran -fopenmp dynamic.f90 
$ ./a.out
                                        0
                                       64
                                      832
                                      256
                                      320
                                      960
                                      576
                                      192
                                      896
                                      640
                                      128
                                      384
                                      704
                                      768
                                      512
                                      448
                                     1024
$ /usr/bin/gfortran -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
11.3.0-1ubuntu1~22.04.1' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-11
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-11-aYxV0E/gcc-11-11.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-aYxV0E/gcc-11-11.3.0/debian/tmp-gcn/usr
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04.1)

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

end of thread, other threads:[~2024-05-07  7:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28 10:49 [Bug libgomp/110842] New: [14 Regression] Openmp loops with KIND=16 DO loops tkoenig at gcc dot gnu.org
2023-07-28 10:55 ` [Bug libgomp/110842] " tkoenig at gcc dot gnu.org
2023-07-28 10:57 ` jakub at gcc dot gnu.org
2023-07-28 11:10 ` tkoenig at gcc dot gnu.org
2023-07-28 12:02 ` burnus at gcc dot gnu.org
2024-01-10 14:49 ` jamborm at gcc dot gnu.org
2024-03-22 13:42 ` law at gcc dot gnu.org
2024-05-07  7:41 ` [Bug libgomp/110842] [14/15 " rguenth 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).