public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60366] New: ICE with self-invoking lambdas
@ 2014-02-28 15:18 jengelh at inai dot de
  2015-02-10  6:18 ` [Bug c++/60366] " pinskia at gcc dot gnu.org
  2015-02-10  6:18 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: jengelh at inai dot de @ 2014-02-28 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60366
           Summary: ICE with self-invoking lambdas
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jengelh at inai dot de

This not-so-serious code:

$ cat w.cpp 
int main(int argc, const char **argv)
{
        auto f = [](const struct __lambda0 &self) { self(self); };
        f(f);
        return 0;
}

causes an ICE instead of just exiting(1):

$ g++ w.cpp -std=gnu++11 -o w -ggdb3 -Wall
w.cpp: In lambda function:
w.cpp:3:55: error: use of ‘main(int, const char**)::__lambda0’ before deduction
of ‘auto’
  auto f = [](const struct __lambda0 &self) { self(self); };
                                                       ^
w.cpp:3:55: error: invalid use of ‘auto’
g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.8/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib
--enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --enable-linker-build-id
--enable-linux-futex --program-suffix=-4.8 --without-system-libunwind
--with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
--host=x86_64-suse-linux
Thread model: posix
gcc version 4.8.2 20140225 [gcc-4_8-branch revision 208119] (SUSE Linux) 

$ g++-4.9 w.cpp -std=gnu++11 -o w -ggdb3 -Wall
g++-4.9: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.

$ g++-4.9 -v
Using built-in specs.
COLLECT_GCC=g++-4.9
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.9/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada,go --enable-checking=yes
--with-gxx-include-dir=/usr/include/c++/4.9 --enable-ssp --disable-libssp
--disable-libvtv --disable-plugin --with-bugurl=http://bugs.opensuse.org/
--with-pkgversion='SUSE Linux' --disable-libgcj --with-slibdir=/lib64
--with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new
--disable-libstdcxx-pch --enable-version-specific-runtime-libs
--enable-linker-build-id --enable-linux-futex --program-suffix=-4.9
--without-system-libunwind --enable-multilib --with-arch-32=i586
--with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
gcc version 4.9.0 20140226 (experimental) [trunk revision 208172] (SUSE Linux)
>From gcc-bugs-return-445091-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Feb 28 16:05:29 2014
Return-Path: <gcc-bugs-return-445091-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2610 invoked by alias); 28 Feb 2014 16:05:28 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 2570 invoked by uid 48); 28 Feb 2014 16:05:23 -0000
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/60359] [OOP] symbol `__io_MOD___copy_character_1' is already defined
Date: Fri, 28 Feb 2014 16:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: janus at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: janus at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc assigned_to short_desc everconfirmed
Message-ID: <bug-60359-4-O5jJrQhuDf@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60359-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60359-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-02/txt/msg02848.txt.bz2
Content-length: 2851

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`359

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-02-28
                 CC|                            |janus at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |janus at gcc dot gnu.org
            Summary|Assembler messages symbol   |[OOP] symbol
                   |`__io_MOD___copy_character_ |`__io_MOD___copy_character_
                   |1' is already defined       |1' is already defined
     Ever confirmed|0                           |1

--- Comment #4 from janus at gcc dot gnu.org ---
This is due to a small bug in find_intrinsic_vtab. Patch:


Index: gcc/fortran/class.c
==================================================================--- gcc/fortran/class.c    (revision 208224)
+++ gcc/fortran/class.c    (working copy)
@@ -2532,17 +2532,22 @@ find_intrinsic_vtab (gfc_typespec *ts)
           c->tb = XCNEW (gfc_typebound_proc);
           c->tb->ppc = 1;

-          /* Check to see if copy function already exists.  Note
-         that this is only used for characters of different
-         lengths.  */
-          contained = ns->contained;
-          for (; contained; contained = contained->sibling)
-        if (contained->proc_name
-            && strcmp (name, contained->proc_name->name) == 0)
-          {
-            copy = contained->proc_name;
-            goto got_char_copy;
-          }
+          if (ts->type != BT_CHARACTER)
+        sprintf (name, "__copy_%s", tname);
+          else
+        {
+          /* __copy is always the same for characters.
+             Check to see if copy function already exists.  */
+          sprintf (name, "__copy_character_%d", ts->kind);
+          contained = ns->contained;
+          for (; contained; contained = contained->sibling)
+            if (contained->proc_name
+            && strcmp (name, contained->proc_name->name) == 0)
+              {
+            copy = contained->proc_name;
+            goto got_char_copy;
+              }
+        }

           /* Set up namespace.  */
           sub_ns = gfc_get_namespace (ns, 0);
@@ -2550,11 +2555,6 @@ find_intrinsic_vtab (gfc_typespec *ts)
           ns->contained = sub_ns;
           sub_ns->resolved = 1;
           /* Set up procedure symbol.  */
-          if (ts->type != BT_CHARACTER)
-        sprintf (name, "__copy_%s", tname);
-          else
-        /* __copy is always the same for characters.  */
-        sprintf (name, "__copy_character_%d", ts->kind);
           gfc_get_symbol (name, sub_ns, &copy);
           sub_ns->proc_name = copy;
           copy->attr.flavor = FL_PROCEDURE;


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

* [Bug c++/60366] ICE with self-invoking lambdas
  2014-02-28 15:18 [Bug c++/60366] New: ICE with self-invoking lambdas jengelh at inai dot de
@ 2015-02-10  6:18 ` pinskia at gcc dot gnu.org
  2015-02-10  6:18 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-02-10  6:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is ICEing while trying to print out about the lambda.


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

* [Bug c++/60366] ICE with self-invoking lambdas
  2014-02-28 15:18 [Bug c++/60366] New: ICE with self-invoking lambdas jengelh at inai dot de
  2015-02-10  6:18 ` [Bug c++/60366] " pinskia at gcc dot gnu.org
@ 2015-02-10  6:18 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-02-10  6:18 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic,
                   |                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-02-10
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed:
#0  pp_c_type_qualifier_list (pp=pp@entry=0x1662488 <scratch_pretty_printer>,
t=t@entry=0x3ffb5dc3b10) at ../../gcc/c-family/c-pretty-print.c:275
#1  0x0000000000858798 in pp_c_specifier_qualifier_list (pp=0x1662488
<scratch_pretty_printer>, t=0x3ffb5dc3b10) at
../../gcc/c-family/c-pretty-print.c:469
#2  0x00000000006bc208 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb5dc3b10, flags=flags@entry=0) at
../../gcc/cp/error.c:829
#3  0x00000000006bc194 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb5dc3bb8, flags=flags@entry=0) at
../../gcc/cp/error.c:749
#4  0x00000000006bc194 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb5dc4788, flags=flags@entry=0) at
../../gcc/cp/error.c:749
#5  0x00000000006baeb0 in dump_type (pp=0x1662488 <scratch_pretty_printer>,
t=<optimized out>, flags=0) at ../../gcc/cp/error.c:528
#6  0x00000000006c329c in dump_parameters (pp=pp@entry=0x1662488
<scratch_pretty_printer>, parmtypes=0x3ffb602db60,
parmtypes@entry=0x3ffb602db38, flags=<optimized out>, flags@entry=1) at
../../gcc/cp/error.c:1624
#7  0x00000000006c66a8 in dump_function_decl (pp=0x1662488
<scratch_pretty_printer>, t=0x3ffb604ec00, flags=flags@entry=1) at
../../gcc/cp/error.c:1559
#8  0x00000000006c6e88 in dump_scope (pp=pp@entry=0x1662488
<scratch_pretty_printer>, scope=<optimized out>, flags=flags@entry=5) at
../../gcc/cp/error.c:178
#9  0x00000000006ba2b8 in dump_aggr_type (pp=0x1662488
<scratch_pretty_printer>, t=<optimized out>, flags=4) at
../../gcc/cp/error.c:682
#10 0x00000000006bc208 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb6061650, flags=flags@entry=4) at
../../gcc/cp/error.c:829
#11 0x00000000006bc194 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb60616f8, flags=flags@entry=4) at
../../gcc/cp/error.c:749
#12 0x00000000006baeb0 in dump_type (pp=0x1662488 <scratch_pretty_printer>,
t=<optimized out>, flags=4) at ../../gcc/cp/error.c:528
#13 0x00000000006c329c in dump_parameters (pp=pp@entry=0x1662488
<scratch_pretty_printer>, parmtypes=0x3ffb602ddb8, flags=<optimized out>,
flags@entry=4) at ../../gcc/cp/error.c:1624
#14 0x00000000006ba898 in dump_aggr_type (pp=0x1662488
<scratch_pretty_printer>, t=<optimized out>, flags=4) at
../../gcc/cp/error.c:711
#15 0x00000000006bc208 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb6061650, flags=flags@entry=4) at
../../gcc/cp/error.c:829
#16 0x00000000006bc194 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb60616f8, flags=flags@entry=4) at
../../gcc/cp/error.c:749
#17 0x00000000006baeb0 in dump_type (pp=0x1662488 <scratch_pretty_printer>,
t=<optimized out>, flags=4) at ../../gcc/cp/error.c:528
#18 0x00000000006c329c in dump_parameters (pp=pp@entry=0x1662488
<scratch_pretty_printer>, parmtypes=0x3ffb602ddb8, flags=<optimized out>,
flags@entry=4) at ../../gcc/cp/error.c:1624
#19 0x00000000006ba898 in dump_aggr_type (pp=0x1662488
<scratch_pretty_printer>, t=<optimized out>, flags=4) at
../../gcc/cp/error.c:711
#20 0x00000000006bc208 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb6061650, flags=flags@entry=4) at
../../gcc/cp/error.c:829
#21 0x00000000006bc194 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb60616f8, flags=flags@entry=4) at
../../gcc/cp/error.c:749
#22 0x00000000006baeb0 in dump_type (pp=0x1662488 <scratch_pretty_printer>,
t=<optimized out>, flags=4) at ../../gcc/cp/error.c:528
#23 0x00000000006c329c in dump_parameters (pp=pp@entry=0x1662488
<scratch_pretty_printer>, parmtypes=0x3ffb602ddb8, flags=<optimized out>,
flags@entry=4) at ../../gcc/cp/error.c:1624
#24 0x00000000006ba898 in dump_aggr_type (pp=0x1662488
<scratch_pretty_printer>, t=<optimized out>, flags=4) at
../../gcc/cp/error.c:711
#25 0x00000000006bc208 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb6061650, flags=flags@entry=4) at
../../gcc/cp/error.c:829
#26 0x00000000006bc194 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb60616f8, flags=flags@entry=4) at
../../gcc/cp/error.c:749
#27 0x00000000006baeb0 in dump_type (pp=0x1662488 <scratch_pretty_printer>,
t=<optimized out>, flags=4) at ../../gcc/cp/error.c:528
#28 0x00000000006c329c in dump_parameters (pp=pp@entry=0x1662488
<scratch_pretty_printer>, parmtypes=0x3ffb602ddb8, flags=<optimized out>,
flags@entry=4) at ../../gcc/cp/error.c:1624
#29 0x00000000006ba898 in dump_aggr_type (pp=0x1662488
<scratch_pretty_printer>, t=<optimized out>, flags=4) at
../../gcc/cp/error.c:711
#30 0x00000000006bc208 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb6061650, flags=flags@entry=4) at
../../gcc/cp/error.c:829
#31 0x00000000006bc194 in dump_type_prefix (pp=pp@entry=0x1662488
<scratch_pretty_printer>, t=t@entry=0x3ffb60616f8, flags=flags@entry=4) at
../../gcc/cp/error.c:749
#32 0x00000000006baeb0 in dump_type (pp=0x1662488 <scratch_pretty_printer>,
t=<optimized out>, flags=4) at ../../gcc/cp/error.c:528
#33 0x00000000006c329c in dump_parameters (pp=pp@entry=0x1662488
<scratch_pretty_printer>, parmtypes=0x3ffb602ddb8, flags=<optimized out>,
flags@entry=4) at ../../gcc/cp/error.c:1624
#34 0x00000000006ba898 in dump_aggr_type (pp=0x1662488
<scratch_pretty_printer>, t=<optimized out>, flags=4) at
../../gcc/cp/error.c:711


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

end of thread, other threads:[~2015-02-10  6:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-28 15:18 [Bug c++/60366] New: ICE with self-invoking lambdas jengelh at inai dot de
2015-02-10  6:18 ` [Bug c++/60366] " pinskia at gcc dot gnu.org
2015-02-10  6:18 ` pinskia at gcc dot gnu.org

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).