[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2013-03-16 Thread paolo.carlini at oracle dot com


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



Paolo Carlini  changed:



   What|Removed |Added



 CC||allocator64 at gmail dot

   ||com



--- Comment #24 from Paolo Carlini  2013-03-16 
13:04:11 UTC ---

*** Bug 56632 has been marked as a duplicate of this bug. ***


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2013-02-20 Thread paolo.carlini at oracle dot com


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



Paolo Carlini  changed:



   What|Removed |Added



 CC||jetrull at sbcglobal dot

   ||net



--- Comment #23 from Paolo Carlini  2013-02-20 
23:27:22 UTC ---

*** Bug 56413 has been marked as a duplicate of this bug. ***


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2013-02-13 Thread paolo.carlini at oracle dot com


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



Paolo Carlini  changed:



   What|Removed |Added



 CC||crillion at tiscali dot it



--- Comment #22 from Paolo Carlini  2013-02-13 
10:40:03 UTC ---

*** Bug 56304 has been marked as a duplicate of this bug. ***


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2013-02-12 Thread paolo.carlini at oracle dot com


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



Paolo Carlini  changed:



   What|Removed |Added



 CC||ers.trion at gmail dot com



--- Comment #21 from Paolo Carlini  2013-02-12 
14:41:23 UTC ---

*** Bug 56299 has been marked as a duplicate of this bug. ***


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2013-01-03 Thread paolo.carlini at oracle dot com


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



Paolo Carlini  changed:



   What|Removed |Added



 CC||kyle.t.konrad at gmail dot

   ||com



--- Comment #20 from Paolo Carlini  2013-01-03 
16:21:31 UTC ---

*** Bug 55853 has been marked as a duplicate of this bug. ***


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-11-29 Thread paolo.carlini at oracle dot com


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



Paolo Carlini  changed:



   What|Removed |Added



 CC||etlverified at gmail dot

   ||com



--- Comment #19 from Paolo Carlini  2012-11-29 
22:19:50 UTC ---

*** Bug 55538 has been marked as a duplicate of this bug. ***


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-11-29 Thread jason at gcc dot gnu.org


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



Jason Merrill  changed:



   What|Removed |Added



 Status|REOPENED|RESOLVED

 Resolution||FIXED



--- Comment #18 from Jason Merrill  2012-11-29 
20:28:31 UTC ---

Should really be fixed now.


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-11-29 Thread jason at gcc dot gnu.org


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



--- Comment #17 from Jason Merrill  2012-11-29 
20:17:36 UTC ---

Author: jason

Date: Thu Nov 29 20:17:20 2012

New Revision: 193957



URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193957

Log:

PR c++/53137

* pt.c (tsubst_expr) [DECL_EXPR]: Set LAMBDA_EXPR_THIS_CAPTURE here.

(tsubst_copy_and_build) [LAMBDA_EXPR]: And clear it here.

(instantiate_class_template_1): Not here.



Added:

branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this6.C

Modified:

branches/gcc-4_7-branch/gcc/cp/ChangeLog

branches/gcc-4_7-branch/gcc/cp/cp-tree.h

branches/gcc-4_7-branch/gcc/cp/pt.c


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-11-29 Thread jason at gcc dot gnu.org


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



--- Comment #16 from Jason Merrill  2012-11-29 
20:13:04 UTC ---

Author: jason

Date: Thu Nov 29 20:12:58 2012

New Revision: 193954



URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193954

Log:

PR c++/53137

* pt.c (tsubst_expr) [DECL_EXPR]: Set LAMBDA_EXPR_THIS_CAPTURE here.

(tsubst_copy_and_build) [LAMBDA_EXPR]: And clear it here.

(instantiate_class_template_1): Not here.



Added:

trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this6.C

Modified:

trunk/gcc/cp/ChangeLog

trunk/gcc/cp/cp-tree.h

trunk/gcc/cp/pt.c


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-11-29 Thread paolo.carlini at oracle dot com


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



--- Comment #15 from Paolo Carlini  2012-11-29 
15:36:53 UTC ---

Frankly, additional examples which are neither self-contained nor minimized

don't help that much. That said, this is a regression and we have already a

minimized snippet, thus we are set. When the bug will be closed, please double

check that the fix works for your code too, thanks!


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-11-29 Thread oakad at yahoo dot com


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



Alexander Dubov  changed:



   What|Removed |Added



 CC||oakad at yahoo dot com



--- Comment #14 from Alexander Dubov  2012-11-29 
15:31:46 UTC ---

Because this bug is so annoying, I thought it may be helpful if I add an

another example:

(clang-3.1 works in all cases)



template 

struct test {

test(std::initializer_list l)

{

insert(l.begin(), l.end());

}



template 

void insert(input_iter_t first, input_iter_t last)

{

std::for_each(

first, last, [this](value_type const &v) -> void {

// works on both gcc-4.6.3 and gcc-4.7.2

this->insert(v);

// won't compile on 4.6.3,

// ICE at tree-ssa-operands.c:1035 on 4.7.2

insert(v);

}

);

}



void insert(value_type const &v)

{

std::cout << v << std::endl;

}

};


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-11-19 Thread paolo.carlini at oracle dot com


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



Paolo Carlini  changed:



   What|Removed |Added



 CC||david at aitellu dot com



--- Comment #13 from Paolo Carlini  2012-11-19 
14:58:49 UTC ---

*** Bug 55392 has been marked as a duplicate of this bug. ***


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-11-02 Thread paolo.carlini at oracle dot com


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



Paolo Carlini  changed:



   What|Removed |Added



 CC||m101010a at gmail dot com



--- Comment #12 from Paolo Carlini  2012-11-02 
11:52:07 UTC ---

*** Bug 54431 has been marked as a duplicate of this bug. ***


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-11-02 Thread paolo.carlini at oracle dot com


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



Paolo Carlini  changed:



   What|Removed |Added



 CC||zsojka at seznam dot cz



--- Comment #11 from Paolo Carlini  2012-11-02 
11:51:00 UTC ---

*** Bug 53697 has been marked as a duplicate of this bug. ***


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-09-26 Thread rguenth at gcc dot gnu.org


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



--- Comment #10 from Richard Guenther  2012-09-26 
11:34:49 UTC ---

Probably wants a new bugreport, but confirmed:



(gdb) call debug_gimple_stmt (stmt)

__this.0 = __this;



and __this is



 

unit size 



eh, a bare FIELD_DECL?!



Store::updateChild(const T&) [with T = int]:: (const struct __lambda0

* const __closure)

{

  struct Store * __this.0;

  int & D.2050;

  struct Store * const this [value-expr: ((const struct __lambda0 *)

__closure)->__this];



  __this.0 = __this;

  D.2050 = Store::getStore (__this.0);



possibly confused from this.


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-09-26 Thread valery.bickov+gcc at gmail dot com


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



valery.bickov+gcc at gmail dot com changed:



   What|Removed |Added



 Status|RESOLVED|REOPENED

 Resolution|FIXED   |



--- Comment #8 from Jason Merrill  2012-06-20 
07:22:00 UTC ---

Author: jason

Date: Wed Jun 20 07:21:55 2012

New Revision: 188810



URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188810

Log:

Reapply:

PR c++/53137

* pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.

(instantiate_decl): Don't push_to_top_level for local class methods.

(instantiate_class_template_1): Or for local classes.



Added:

   

branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C

Modified:

branches/gcc-4_7-branch/gcc/cp/ChangeLog

branches/gcc-4_7-branch/gcc/cp/pt.c

branches/gcc-4_7-branch/gcc/testsuite/ChangeLog



--- Comment #9 from valery.bickov+gcc at gmail dot com 2012-09-26 11:12:24 UTC 
---

Slightly modified example still crashes on 4.7.2:



template 

void getParent(STORE& tStore)

{

}



struct  Store

{

template 

void updateChildCommon(CheckParentFunc c)

{

c();

}



template 

int& getStore();



template 

void updateChild(const T& obj)

{

updateChildCommon([this] () { getParent(getStore()); });

}



void update(int obj);

};



void Store::update(int obj)

{

updateChild(obj);

}



$ /usr/local/gcc-4.7.2/bin/g++ -c gcc-4.7.2-crash.cpp -std=c++11

gcc-4.7.2-crash.cpp: In lambda function:

gcc-4.7.2-crash.cpp:29: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  for instructions.



$ /usr/local/gcc-4.7.2/bin/g++ -v

Using built-in specs.

COLLECT_GCC=/usr/local/gcc-4.7.2/bin/g++

COLLECT_LTO_WRAPPER=/usr/local/gcc-4.7.2/libexec/gcc/x86_64-unknown-linux-gnu/4.7.2/lto-wrapper

Target: x86_64-unknown-linux-gnu

Configured with: ./configure --prefix=/usr/local/gcc-4.7.2 --enable-lto

--disable-multilib --enable-languages=c,c++

Thread model: posix

gcc version 4.7.2 (GCC) 



It compiles ok if I remove c() call or move update(int) definition body into

class.



g++-4.6.3 works with it.



I changed status to reopened excuse me if I shouldn't do it.


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-06-20 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

--- Comment #8 from Jason Merrill  2012-06-20 
07:22:00 UTC ---
Author: jason
Date: Wed Jun 20 07:21:55 2012
New Revision: 188810

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188810
Log:
Reapply:
PR c++/53137
* pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
(instantiate_decl): Don't push_to_top_level for local class methods.
(instantiate_class_template_1): Or for local classes.

Added:
   
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C
Modified:
branches/gcc-4_7-branch/gcc/cp/ChangeLog
branches/gcc-4_7-branch/gcc/cp/pt.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-06-12 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

Jason Merrill  changed:

   What|Removed |Added

   Target Milestone|4.7.1   |4.7.2

--- Comment #7 from Jason Merrill  2012-06-12 
15:06:27 UTC ---
Fix pushed off to 4.7.2.


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-06-12 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

--- Comment #6 from Jason Merrill  2012-06-12 
15:01:31 UTC ---
Author: jason
Date: Tue Jun 12 15:01:17 2012
New Revision: 188460

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188460
Log:
PR c++/53599
Revert:
PR c++/53137
* pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
(instantiate_decl): Don't push_to_top_level for local class methods.
(instantiate_class_template_1): Or for local classes.

Added:
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/template/local7.C
Removed:
   
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C
Modified:
branches/gcc-4_7-branch/gcc/cp/ChangeLog
branches/gcc-4_7-branch/gcc/cp/pt.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-06-01 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #5 from Jason Merrill  2012-06-01 
18:47:13 UTC ---
Fixed for 4.7.1.


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-06-01 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

--- Comment #4 from Jason Merrill  2012-06-01 
18:43:39 UTC ---
Author: jason
Date: Fri Jun  1 18:43:34 2012
New Revision: 188123

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188123
Log:
PR c++/53137
* pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
(instantiate_decl): Don't push_to_top_level for local class methods.
(instantiate_class_template_1): Or for local classes.

Added:
   
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C
Modified:
branches/gcc-4_7-branch/gcc/cp/ChangeLog
branches/gcc-4_7-branch/gcc/cp/pt.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-06-01 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

--- Comment #3 from Jason Merrill  2012-06-01 
16:55:21 UTC ---
Author: jason
Date: Fri Jun  1 16:55:17 2012
New Revision: 188117

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188117
Log:
PR c++/53137
* pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
(instantiate_decl): Don't push_to_top_level for local class methods.
(instantiate_class_template_1): Or for local classes.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-05-31 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org
   |gnu.org |


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-05-29 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

Richard Guenther  changed:

   What|Removed |Added

   Priority|P3  |P2


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-05-23 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  2012-05-23 
12:26:54 UTC ---
Probably started ICEing with
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177995


[Bug c++/53137] [4.7/4.8 Regression] g++ segfault

2012-04-27 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

Richard Guenther  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-04-27
   Target Milestone|--- |4.7.1
Summary|g++ segfault|[4.7/4.8 Regression] g++
   ||segfault
 Ever Confirmed|0   |1

--- Comment #1 from Richard Guenther  2012-04-27 
10:41:55 UTC ---
Confirmed.  4.6 rejects the testcase.