public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/110842] New: [14 Regression] Openmp loops with KIND=16 DO loops
Date: Fri, 28 Jul 2023 10:49:32 +0000	[thread overview]
Message-ID: <bug-110842-4@http.gcc.gnu.org/bugzilla/> (raw)

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)

             reply	other threads:[~2023-07-28 10:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28 10:49 tkoenig at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110842-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).