[Bug c++/87180] New: Pointer to member function comparison fails on hppa-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87180 Bug ID: 87180 Summary: Pointer to member function comparison fails on hppa-linux-gnu Product: gcc Version: 8.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mattias.ellert at physics dot uu.se Target Milestone: --- Host: hppa-linux-gnu Target: hppa-linux-gnu Build: hppa-linux-gnu Created attachment 44643 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44643&action=edit Test case illustrating the problem. The attached tarball contains a reduced test case for a compilation failure that occurs in a package I maintain for Debian Linux. The package compiles without problem on all Debian architectures except hppa. The issue only happens when linking using a shared library. If the test case is linked statically the issue does not appear. On all architectures except hppa the output of the test case is the following: $ make g++ -O2 -g -c -o main.o main.cpp g++ -O2 -g -fPIC -c -o S.o S.cpp g++ -shared -o libS.so S.o g++ -o main main.o -L. -lS g++ -o altmain main.o S.o -- Running using shared library LD_LIBRARY_PATH=. ./main OK -- Running using static build ./altmain OK On hppa the output is as follows: $ make g++ -O2 -g -c -o main.o main.cpp g++ -O2 -g -fPIC -c -o S.o S.cpp g++ -shared -o libS.so S.o g++ -o main main.o -L. -lS g++ -o altmain main.o S.o -- Running using shared library LD_LIBRARY_PATH=. ./main not OK -- Running using static build ./altmain OK Details about host and compiler: $ uname -a Linux panama 4.17.0-2-parisc64-smp #1 SMP Debian 4.17.14-1 (2018-08-13) parisc64 GNU/Linux $ g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/hppa-linux-gnu/8/lto-wrapper Target: hppa-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 8.2.0-4' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=hppa-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libssp --disable-libitm --disable-libsanitizer --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --disable-libphobos --enable-objc-gc=auto --enable-multiarch --disable-werror --disable-libstdcxx-pch --enable-checking=release --build=hppa-linux-gnu --host=hppa-linux-gnu --target=hppa-linux-gnu Thread model: posix gcc version 8.2.0 (Debian 8.2.0-4)
[Bug tree-optimization/104336] bogus -Wrestrict for std::string assignment with
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104336 Mattias Ellert changed: What|Removed |Added CC||mattias.ellert at physics dot uu.s ||e --- Comment #1 from Mattias Ellert --- Created attachment 52872 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52872&action=edit Proposed fix Proposed fix: ``` {.diff} --- usr/include/c++/12/bits/basic_string.tcc.orig 2022-04-14 01:23:43.0 +0200 +++ usr/include/c++/12/bits/basic_string.tcc2022-04-25 16:18:57.028352162 +0200 @@ -527,10 +527,10 @@ } else { - const size_type __nleft = (__p + __len1) - __s; - this->_S_move(__p, __s, __nleft); - this->_S_copy(__p + __nleft, __p + __len2, - __len2 - __nleft); + const size_type __nleft = (__s + __len2) - (__p + __len1); + this->_S_move(__p, __s, __len2 - __nleft); + this->_S_copy(__p + __len2 - __nleft, __p + __len2, + __nleft); } } } ```
[Bug tree-optimization/105329] Bogus restrict warning when assigning 1-char string literal to std::string
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 Mattias Ellert changed: What|Removed |Added CC||mattias.ellert at physics dot uu.s ||e --- Comment #6 from Mattias Ellert --- This is a duplicate of bug #104336.
[Bug tree-optimization/105329] [12/13 Regression] Bogus restrict warning when assigning 1-char string literal to std::string since r12-3347-g8af8abfbbace49e6
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 --- Comment #18 from Mattias Ellert --- If the additional symbols are undesirable, using the workaround proposed in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104336#c1 is an alternative. This silences the warning without adding additional symbols. This proposed change is similar to the change introduced a few lines further up in the same file in the following commit: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e14ea108faa6eba6a60a45ff0ca3099ce6ae45c2 This change was introduced to fix a similar false positive warning in GCC 11.