public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54431] New: [C++11] g++ crashes when compiling the following file
@ 2012-08-30 23:44 m101010a at gmail dot com
  2012-09-01 22:04 ` [Bug c++/54431] " m101010a at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: m101010a at gmail dot com @ 2012-08-30 23:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54431

             Bug #: 54431
           Summary: [C++11] g++ crashes when compiling the following file
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: m101010a@gmail.com


$ cat y.cpp
template <class>
struct foo
{
public:
    void bar()
    {
        [this]{bar();}();
    }
};

int main()
{
    foo<int> ss;
    ss.bar();
}
$ g++ -v -save-temps -std=c++11 y.cpp
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/src/gcc-4.7-20120721/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id
--with-ppl --enable-cloog-backend=isl --disable-ppl-version-check
--disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default
--enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu
--enable-multilib --disable-libssp --disable-build-with-cxx
--disable-build-poststage1-with-cxx --enable-checking=release
Thread model: posix
gcc version 4.7.1 20120721 (prerelease) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1plus -E -quiet -v -D_GNU_SOURCE
y.cpp -mtune=generic -march=x86-64 -std=c++11 -fpch-preprocess -o y.ii
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/x86_64-unknown-linux-gnu

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/backward
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/include
 /usr/local/include
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1plus -fpreprocessed y.ii -quiet
-dumpbase y.cpp -mtune=generic -march=x86-64 -auxbase y -std=c++11 -version -o
y.s
GNU C++ (GCC) version 4.7.1 20120721 (prerelease) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.7.1 20120721 (prerelease), GMP version 5.0.5,
MPFR version 3.1.1, MPC version 1.0
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.7.1 20120721 (prerelease) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.7.1 20120721 (prerelease), GMP version 5.0.5,
MPFR version 3.1.1, MPC version 1.0
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 8466381cd327359656bc3ec3a9c33398
y.cpp: In lambda function:
y.cpp:15:1: internal compiler error: in get_expr_operands, at
tree-ssa-operands.c:1035
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
$ cat y.ii
# 1 "y.cpp"
# 1 "<command-line>"
# 1 "y.cpp"
template <class>
struct foo
{
public:
 void bar()
 {
  [this]{bar();}();
 }
};

int main()
{
 foo<int> ss;
 ss.bar();
}

Gcc doesn't crash if foo is not a templated class.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/54431] [C++11] g++ crashes when compiling the following file
  2012-08-30 23:44 [Bug c++/54431] New: [C++11] g++ crashes when compiling the following file m101010a at gmail dot com
@ 2012-09-01 22:04 ` m101010a at gmail dot com
  2012-10-01 16:37 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: m101010a at gmail dot com @ 2012-09-01 22:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54431

--- Comment #1 from m101010a at gmail dot com 2012-09-01 22:04:04 UTC ---
Gcc also doesn't crash if the lambda line is changed to

[this]{this->bar();}();

Although the resulting program does.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/54431] [C++11] g++ crashes when compiling the following file
  2012-08-30 23:44 [Bug c++/54431] New: [C++11] g++ crashes when compiling the following file m101010a at gmail dot com
  2012-09-01 22:04 ` [Bug c++/54431] " m101010a at gmail dot com
@ 2012-10-01 16:37 ` paolo.carlini at oracle dot com
  2012-10-31 21:54 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-01 16:37 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54431

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-01
             Blocks|                            |54367
     Ever Confirmed|0                           |1

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-01 16:37:21 UTC ---
Confirmed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/54431] [C++11] g++ crashes when compiling the following file
  2012-08-30 23:44 [Bug c++/54431] New: [C++11] g++ crashes when compiling the following file m101010a at gmail dot com
  2012-09-01 22:04 ` [Bug c++/54431] " m101010a at gmail dot com
  2012-10-01 16:37 ` paolo.carlini at oracle dot com
@ 2012-10-31 21:54 ` paolo.carlini at oracle dot com
  2012-10-31 22:27 ` icegood1980 at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-31 21:54 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54431

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |icegood1980 at gmail dot
                   |                            |com

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-31 21:53:38 UTC ---
*** Bug 55156 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/54431] [C++11] g++ crashes when compiling the following file
  2012-08-30 23:44 [Bug c++/54431] New: [C++11] g++ crashes when compiling the following file m101010a at gmail dot com
                   ` (2 preceding siblings ...)
  2012-10-31 21:54 ` paolo.carlini at oracle dot com
@ 2012-10-31 22:27 ` icegood1980 at gmail dot com
  2012-11-01  7:46 ` markus at trippelsdorf dot de
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: icegood1980 at gmail dot com @ 2012-10-31 22:27 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54431

--- Comment #4 from icegood1980 at gmail dot com <icegood1980 at gmail dot com> 2012-10-31 22:26:46 UTC ---
(In reply to comment #1)
> Gcc also doesn't crash if the lambda line is changed to
> 
> [this]{this->bar();}();
> 
> Although the resulting program does.

Of course, resulting program should crash because you have infinite reccursion
call. Anyway next code crashes too:
#include <iostream>

template <class>
struct foo
{
public:
 void blah()
 {
  std::cerr<<"blah-blah"<<std::endl;
 }
 void bar()
 {
  [this]{blah();}();
 }
};

int main()
{
 foo<int> ss;
 ss.bar();
}

For workaround with [this] thanks, i should guess...


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/54431] [C++11] g++ crashes when compiling the following file
  2012-08-30 23:44 [Bug c++/54431] New: [C++11] g++ crashes when compiling the following file m101010a at gmail dot com
                   ` (3 preceding siblings ...)
  2012-10-31 22:27 ` icegood1980 at gmail dot com
@ 2012-11-01  7:46 ` markus at trippelsdorf dot de
  2012-11-02 11:44 ` markus at trippelsdorf dot de
  2012-11-02 11:52 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: markus at trippelsdorf dot de @ 2012-11-01  7:46 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54431

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus at trippelsdorf dot
                   |                            |de

--- Comment #5 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-11-01 07:46:30 UTC ---
unhandled expression in get_expr_operands():
 <field_decl 0x59f6a18 __this
    type <pointer_type 0x5a01a80
        type <record_type 0x5a017e0 A sizes-gimplified type_5 type_6 QI
            size <integer_cst 0x58acf80 constant 8>
            unit size <integer_cst 0x58acfa0 constant 1>
            align 8 symtab 0 alias set -1 canonical type 0x5a017e0 fields
<type_decl 0x5a03450 A> context <translation_unit_decl 0x58c5170 D.1>
            full-name "struct A<int>"
            X() X(constX&) this=(X&) n_parents=0 use_template=1
interface-unknown
            pointer_to_this <pointer_type 0x5a01930> chain <type_decl 0x5a032e0
A>>
        readonly sizes-gimplified unsigned DI
        size <integer_cst 0x58acdc0 constant 64>
        unit size <integer_cst 0x58acde0 constant 8>
        align 64 symtab 0 alias set -1 canonical type 0x5a01a80>
    readonly used unsigned nonlocal decl_7 DI file test.ii line 6 col 6 size
<integer_cst 0x58acdc0 64> unit size <integer_cst 0x58acde0 8>
    align 64 offset_align 128
    offset <integer_cst 0x58ace00 type <integer_type 0x58c7000 sizetype>
constant 0>
    bit offset <integer_cst 0x58ace80 type <integer_type 0x58c70a8 bitsizetype>
constant 0> context <record_type 0x5a01dc8 __lambda0> chain <type_decl
0x5a037e8 __lambda0>>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/54431] [C++11] g++ crashes when compiling the following file
  2012-08-30 23:44 [Bug c++/54431] New: [C++11] g++ crashes when compiling the following file m101010a at gmail dot com
                   ` (4 preceding siblings ...)
  2012-11-01  7:46 ` markus at trippelsdorf dot de
@ 2012-11-02 11:44 ` markus at trippelsdorf dot de
  2012-11-02 11:52 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: markus at trippelsdorf dot de @ 2012-11-02 11:44 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54431

--- Comment #6 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-11-02 11:43:50 UTC ---
Dup of Bug 53697 and Bug 53137.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/54431] [C++11] g++ crashes when compiling the following file
  2012-08-30 23:44 [Bug c++/54431] New: [C++11] g++ crashes when compiling the following file m101010a at gmail dot com
                   ` (5 preceding siblings ...)
  2012-11-02 11:44 ` markus at trippelsdorf dot de
@ 2012-11-02 11:52 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-11-02 11:52 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54431

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-11-02 11:52:07 UTC ---
Dup.

*** This bug has been marked as a duplicate of bug 53137 ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-11-02 11:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-30 23:44 [Bug c++/54431] New: [C++11] g++ crashes when compiling the following file m101010a at gmail dot com
2012-09-01 22:04 ` [Bug c++/54431] " m101010a at gmail dot com
2012-10-01 16:37 ` paolo.carlini at oracle dot com
2012-10-31 21:54 ` paolo.carlini at oracle dot com
2012-10-31 22:27 ` icegood1980 at gmail dot com
2012-11-01  7:46 ` markus at trippelsdorf dot de
2012-11-02 11:44 ` markus at trippelsdorf dot de
2012-11-02 11:52 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).