public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/63207] New: ICE in expand_expr_real_l when instantiating a template with a lambda that captures a const variable with a dependent initializer
@ 2014-09-08 14:29 st at quanttec dot com
  2014-10-10  8:53 ` [Bug c++/63207] [5 regression] " paolo.carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: st at quanttec dot com @ 2014-09-08 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63207
           Summary: ICE in expand_expr_real_l when instantiating a
                    template with a lambda that captures a const variable
                    with a dependent initializer
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: st at quanttec dot com

Compiling the following following code with the current trunk GCC results in an
ICE.

template <typename T>
struct Base {
  T value;
};

template <typename T>
struct Test : Base<T> {
  T test() {
    const int x = this->value;
    return ([&]{ return x; })();
  }
};

int main()  {
  Test<int> t;
  t.value = 0;
  return t.test();
}

g++ test.cpp --std=c++11 -Wall
test.cpp: In lambda function:
test.cpp:10:28: warning: ‘x’ is used uninitialized in this function
[-Wuninitialized]
     return ([&]{ return x; })();
                            ^
test.cpp:9:15: note: ‘x’ was declared here
     const int x = this->value;
               ^
test.cpp:10:28: internal compiler error: in expand_expr_real_1, at expr.c:9517
     return ([&]{ return x; })();
                            ^
0x8c96ba expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../gcc/gcc/expr.c:9517
0x8d0dea store_expr(tree_node*, rtx_def*, int, bool)
        ../../gcc/gcc/expr.c:5338
0x8d8e4b expand_assignment(tree_node*, tree_node*, bool)
        ../../gcc/gcc/expr.c:5124
0x7e3b33 expand_gimple_stmt_1
        ../../gcc/gcc/cfgexpand.c:3274
0x7e3b33 expand_gimple_stmt
        ../../gcc/gcc/cfgexpand.c:3376
0x7e99d3 expand_gimple_basic_block
        ../../gcc/gcc/cfgexpand.c:5215
0x7eb86f execute
        ../../gcc/gcc/cfgexpand.c:5821
>From gcc-bugs-return-461433-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Sep 08 14:29:19 2014
Return-Path: <gcc-bugs-return-461433-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 3832 invoked by alias); 8 Sep 2014 14:29:18 -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 3781 invoked by uid 48); 8 Sep 2014 14:29:13 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/63196] [5.0 regression] FAIL: g++.dg/torture/pr57140.C   -O3 -fomit-frame-pointer  (internal compiler error)
Date: Mon, 08 Sep 2014 14:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ipa
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-63196-4-rg7ZaOh9sT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63196-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63196-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-09/txt/msg01267.txt.bz2
Content-length: 428

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

* [Bug c++/63207] [5 regression] ICE in expand_expr_real_l when instantiating a template with a lambda that captures a const variable with a dependent initializer
  2014-09-08 14:29 [Bug c++/63207] New: ICE in expand_expr_real_l when instantiating a template with a lambda that captures a const variable with a dependent initializer st at quanttec dot com
@ 2014-10-10  8:53 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-10-10  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
             Blocks|                            |54367
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.0

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed then.


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

end of thread, other threads:[~2014-10-10  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-08 14:29 [Bug c++/63207] New: ICE in expand_expr_real_l when instantiating a template with a lambda that captures a const variable with a dependent initializer st at quanttec dot com
2014-10-10  8:53 ` [Bug c++/63207] [5 regression] " 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).