public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "my.pvt.emailaddress at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/64948] New: Lambda reference capture initialization in template function creates segmentation fault
Date: Thu, 05 Feb 2015 15:15:00 -0000	[thread overview]
Message-ID: <bug-64948-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 64948
           Summary: Lambda reference capture initialization in template
                    function creates segmentation fault
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: my.pvt.emailaddress at googlemail dot com

Compilation of the following code leads to the

Error Message
//<<<<<<<<<<<<<<<<<<<<<<<<<//
bug.cc: In function ‘void foo(T)’:
bug.cc:4:20: internal compiler error: Segmentation fault
     [&i = t.cbegin()]() {};
                    ^
//>>>>>>>>>>>>>>>>>>>>>>>>>//

The preprocessed file of a minimal testcase:

bug.ii
//<<<<<<<<<<<<<<<<<<<<<<<<<//
# 1 "bug.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "bug.cc"
template <class T>
void
foo(T t) {
    [&i = t.cbegin()]() {};
}

int main() {
    return 0;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>//

This happens with the

g++ version
//<<<<<<<<<<<<<<<<<<<<<<<<<//
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/4.9.2/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /build/gcc/src/gcc-4.9-20141224/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
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-cloog-backend=isl --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu --disable-multilib
--disable-werror --enable-checking=release
Thread model: posix
gcc version 4.9.2 20141224 (prerelease) (GCC)
//>>>>>>>>>>>>>>>>>>>>>>>>>//

and the command
//<<<<<<<<<<<<<<<<<<<<<<<<<//
g++ --std=c++1y bug.cc
//>>>>>>>>>>>>>>>>>>>>>>>>>//

An equivalent(?) code which is perfektly compilable is

nobug.ii
//<<<<<<<<<<<<<<<<<<<<<<<<<//
# 1 "nobug.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "nobug.cc"
template <class T>
void
foo(T t) {
    auto i = t.cbegin();
    [&i]() {};
}

int main() {
    return 0;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>//
>From gcc-bugs-return-476137-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 05 15:22:50 2015
Return-Path: <gcc-bugs-return-476137-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1778 invoked by alias); 5 Feb 2015 15:22:49 -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 28706 invoked by uid 48); 5 Feb 2015 15:22:41 -0000
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/64580] very high rs6000_stack_info() usage during LTO Firefox build on ppc64
Date: Thu, 05 Feb 2015 15:22:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: segher at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-64580-4-0g96LZvBYT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64580-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64580-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: 2015-02/txt/msg00470.txt.bz2
Content-length: 473

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd580

Segher Boessenkool <segher at gcc dot gnu.org> changed:

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

--- Comment #15 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Fixed on all open release branches, closing.


             reply	other threads:[~2015-02-05 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 15:15 my.pvt.emailaddress at googlemail dot com [this message]
2015-02-09 13:30 ` [Bug c++/64948] " andrea.azzarone at canonical dot com
2015-02-09 15:06 ` andrea.azzarone at canonical dot com
2015-03-05  8:34 ` paolo.carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-64948-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).