This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/79937] New: ICE in replace_placeholders_r


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

            Bug ID: 79937
           Summary: ICE in replace_placeholders_r
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc@arne-mertz.de
  Target Milestone: ---

The following code snippet leads to an internal compiler error in GCC 5.3
through 7.0.1:

(see also https://godbolt.org/g/yFPEfx)

## Code

    struct C{};

    struct X {
        unsigned i;
        unsigned n = i;
    };

    C bar(X) {
        return {};
    }

    void foo()
    {
        C c = bar(X{1}); //ICE
    }

## Error message:

<source>: In function 'void foo()':
<source>:14:19: internal compiler error: in replace_placeholders_r, at
cp/tree.c:2524
C c = bar(X{1});
^
mmap: Cannot allocate memory
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Compiler exited with result code 1


## Version information (-v output):


### GCC 7.0.1:

Target: x86_64-linux-gnu
Configured with: ../gcc-trunk-20170306/configure --prefix /root/staging
--build=x86_64-linux-gnu --disable-multilibs --disable-bootstrap
--enable-clocale=gnu --enable-languages=c,c++ --enable-ld=yes --enable-gold=yes
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-linker-build-id
--enable-lto --enable-plugins --enable-threads=posix --host=x86_64-linux-gnu
--target=x86_64-linux-gnu --with-pkgversion=GCC-Explorer-Build
Thread model: posix
gcc version 7.0.1 20170306 (experimental) (GCC-Explorer-Build)


### GCC 5.3.0

Using built-in specs.
COLLECT_GCC=/opt/compiler-explorer/gcc-5.3.0/bin/g++
Target: x86_64-linux-gnu
Configured with: ../gcc-5.3.0/configure --prefix /root/staging
--build=x86_64-linux-gnu --disable-multilibs --enable-clocale=gnu
--enable-languages=c,c++ --enable-ld=yes --enable-gold=yes
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-linker-build-id
--enable-lto --enable-plugins --enable-threads=posix --host=x86_64-linux-gnu
--target=x86_64-linux-gnu --with-pkgversion=GCC-Explorer-Build
Thread model: posix
gcc version 5.3.0 (GCC-Explorer-Build)
COLLECT_GCC_OPTIONS='-g' '-o'
'/tmp/compiler-explorer-compiler11727-6627-1ps4xeb.oclq5mi/output.s'
'-masm=intel' '-S' '-std=c++14' '-v' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
/opt/compiler-explorer/gcc-5.3.0/bin/../libexec/gcc/x86_64-linux-gnu/5.3.0/cc1plus
-quiet -v -imultiarch x86_64-linux-gnu -iprefix
/opt/compiler-explorer/gcc-5.3.0/bin/../lib/gcc/x86_64-linux-gnu/5.3.0/
-D_GNU_SOURCE <source> -quiet -dumpbase example.cpp -masm=intel -mtune=generic
-march=x86-64 -auxbase-strip
/tmp/compiler-explorer-compiler11727-6627-1ps4xeb.oclq5mi/output.s -g
-std=c++14 -version -o
/tmp/compiler-explorer-compiler11727-6627-1ps4xeb.oclq5mi/output.s
GNU C++14 (GCC-Explorer-Build) version 5.3.0 (x86_64-linux-gnu)
compiled by GNU C version 5.3.0, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]