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

            Bug ID: 120006
           Summary: [15 Regression] wrong code with -O2 -fipa-pta
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anhollander516 at gmail dot com
  Target Milestone: ---

Created attachment 61238
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61238&action=edit
preprocessed file from -save-temps

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/15/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-15.1.0/work/gcc-15.1.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/15
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/15/python
--enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror
--with-system-zlib --disable-nls --disable-libunwind-exceptions
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 15.1.0 p55' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --with-multilib-list=m64 --disable-fixed-point
--enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--disable-libada --disable-cet --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--without-zstd --with-isl --disable-isl-version-check --disable-libsanitizer
--enable-default-pie --enable-host-pie --enable-host-bind-now
--enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1
--with-build-config='bootstrap-O3 bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.1.0 (Gentoo 15.1.0 p55)

After rebuilding my two Gentoo systems with GCC 15, I am running into an issue
where util-linux 2.41 fsck isn't properly passing options along to the
filesystem-specific program it calls.

I am able to reproduce it simply by calling fsck -a on any FAT32 filesystem.

Using strace I was able to narrow it down to this:
134444 execve("/usr/bin/fsck.vfat", ["fsck.vfat", "", "/dev/nvme0n1p1"],
0x7ffe3254b7d8 /* 77 vars */) = 0
-a is supposed to be passed through to fsck.vfat, but instead there is an empty
string, which fsck.vfat interprets as an invalid command line argument causing
it to fail.

I narrowed this down to a compiler issue by experimenting with the compiler
flags. The failure constently happens when -fipa-pta is used, and it works
again after removing it. I don't have the know-how to create a code snippet
that reproduces the issue, so I've provided as much as I can here, including
the preprocessed file.

Reply via email to