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

            Bug ID: 121049
           Summary: [16 regression] timezone-data miscompiled with -O3
                    -march=x86-64-v4 -mtune=znver4
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Created attachment 61849
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61849&action=edit
localtime.c

```
$ gcc z2.c -o z2 -O3 -march=x86-64-v4 -mtune=znver4 && ./z2
Aborted                    (core dumped) ./z2
```

```
[...]
Breakpoint 1, transtime (year=year@entry=2007,
rulep=rulep@entry=0x7fffffffd380, offset=offset@entry=-46800) at z2.c:46
46      {
(gdb) finish
Run till exit from #0  transtime (year=year@entry=2007,
rulep=rulep@entry=0x7fffffffd380, offset=offset@entry=-46800) at z2.c:46
0x000055555555441a in main () at z2.c:139
139         if (transtime(2007, &rulep, -46800) != 7740000)
Value returned is $1 = 5320800
```

---

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/16/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/16
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/16/python
--enable-libphobos --enable-languages=c,c++,d,fortran,ada --enable-obsolete
--enable-secureplt --disable-werror --with-system-zlib --enable-nls
--without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo Hardened 16.0.9999 p, commit
fe1f0199d8773ec7dffa4b7b7c26b1dd56cf6fd6' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point
--enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--enable-libada --enable-cet --disable-systemtap --disable-valgrind-annotations
--disable-vtable-verify --disable-libvtv --with-zstd --without-isl
--enable-default-pie --enable-host-pie --enable-host-bind-now
--enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1 --enable-linker-build-id
--with-build-config='bootstrap-O3 bootstrap-cet'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20250712 (experimental)
f3186568d09c02a6d8915e43c0f5d7df704dfa0d (Gentoo Hardened 16.0.9999 p, commit
fe1f0199d8773ec7dffa4b7b7c26b1dd56cf6fd6)

Reply via email to