Bug 94297 - PPCLE std::replace internal compiler error
Summary: PPCLE std::replace internal compiler error
Status: CLOSED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 8.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 94519 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-03-24 10:02 UTC by Jens Seifert
Modified: 2020-04-07 17:26 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc64le-*-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Pre-processed file created using -save-temps (82.00 KB, text/plain)
2020-03-24 19:40 UTC, Jens Seifert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Seifert 2020-03-24 10:02:03 UTC
#include <algorithm>
#include <string>

void patch(std::string& s)
{
   std::replace(s.begin(),s.end(),'.','-');
}

gcc replace.C

In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/uniform_int_dist.h:35,
                 from /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/stl_algo.h:66,
                 from /opt/rh/devtoolset-8/root/usr/include/c++/8/algorithm:62,
                 from replace.C:1:
/opt/rh/devtoolset-8/root/usr/include/c++/8/limits:1677:7: internal compiler error: Segmentation fault
       max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; }
       ^~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccFTVYLT.out file, please attach this to your bugreport.
Comment 1 Jens Seifert 2020-03-24 10:06:23 UTC
Same code compile on x86 on same version of compiler.
Comment 2 Marek Polacek 2020-03-24 17:09:26 UTC
I can't reproduce this with latest trunk on ppc64le.  Can you please provide a preprocessed source file for this ICE?
Comment 3 Jens Seifert 2020-03-24 19:40:39 UTC
Created attachment 48110 [details]
Pre-processed file created using -save-temps
Comment 4 Marek Polacek 2020-03-24 20:12:06 UTC
Still can't reproduce with mainline trunk/9/8.

Since I happen to work on DTS, I've also tried devtoolset-8-gcc-8.2.1-3.el7.ppc64le and devtoolset-8-gcc-8.3.1-3.2.el7.ppc64le but couldn't reproduce it either.  Did you use any special options not mentioned in this bug report?
Comment 5 Jens Seifert 2020-03-24 20:30:08 UTC
No options. Same failure with -O2. System is a RHEL 7.5.

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-8/root/usr/libexec/gcc/ppc64le-redhat-linux/8/lto-wrapper
Target: ppc64le-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-8/root/usr --mandir=/opt/rh/devtoolset-8/root/usr/share/man --infodir=/opt/rh/devtoolset-8/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-targets=powerpcle-linux --disable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-8.3.1-20190311/obj-ppc64le-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --enable-secureplt --with-long-double-128 --with-cpu-32=power8 --with-tune-32=power8 --with-cpu-64=power8 --with-tune-64=power8 --build=ppc64le-redhat-linux
Thread model: posix
gcc version 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)


No error with:
gcc -std=gnu++98 replace.C
gcc -std=gnu++03 replace.C

Error with:
gcc -std=gnu++11 replace.C
gcc -std=gnu++17 replace.C
Comment 6 Andrew Pinski 2020-04-07 14:56:03 UTC
*** Bug 94519 has been marked as a duplicate of this bug. ***
Comment 7 Jens Seifert 2020-04-07 17:11:26 UTC
Too old libgmp got picked up. Setting LD_LIBRARY_PATH=/lib64 solved the issue.
Comment 8 Jens Seifert 2020-04-07 17:12:53 UTC
Too old libgmp got picked up. Setting LD_LIBRARY_PATH=/lib64 solved the issue.
Comment 9 Jens Seifert 2020-04-07 17:14:00 UTC
Too old libgmp got picked up. Setting LD_LIBRARY_PATH=/lib64 solved the issue.