Bug 16851 - [3.5/3.4 Regression] ICE when throwing a comma expression
Summary: [3.5/3.4 Regression] ICE when throwing a comma expression
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.2
Assignee: Jason Merrill
URL:
Keywords: ice-on-valid-code, monitored
Depends on: 16338
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-01 23:52 UTC by Ivan Godard
Modified: 2004-10-30 21:11 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.3.3 3.4.2
Known to fail: 3.4.0 4.0.0
Last reconfirmed: 2004-08-02 00:05:22


Attachments
Compiler output (-v -save-temps) (721 bytes, text/plain)
2004-08-01 23:53 UTC, Ivan Godard
Details
Source code (-save-temps) (105.89 KB, text/plain)
2004-08-01 23:55 UTC, Ivan Godard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Godard 2004-08-01 23:52:50 UTC
 
Comment 1 Ivan Godard 2004-08-01 23:53:21 UTC
Created attachment 6862 [details]
Compiler output (-v -save-temps)
Comment 2 Ivan Godard 2004-08-01 23:55:33 UTC
Created attachment 6863 [details]
Source code (-save-temps)
Comment 3 Andrew Pinski 2004-08-02 00:05:09 UTC
Confirmed, reduced testcase:
struct A
{ A(int); };

void xd(int t) {
 throw(3,A(t)) ;
}

Related to PR 16338.
Comment 4 Andrew Pinski 2004-08-02 00:11:05 UTC
: Search converges between 2004-05-11-trunk (#454) and 2004-05-14-trunk (#455).
Comment 5 Andrew Pinski 2004-08-02 00:14:43 UTC
This one is the one with respect that a COMPOUND_EXPR comes into play:

<compound_expr 0x415c8438
    type <void_type 0x415d4f80 void VOID
        align 8 symtab 0 alias set -1
        pointer_to_this <pointer_type 0x415d5000>>
    side-effects
    arg 0 <convert_expr 0x41758cc0 type <void_type 0x415d4f80 void>
        constant invariant
        arg 0 <integer_cst 0x41758be0 constant invariant 3>>
    arg 1 <aggr_init_expr 0x415c8410 type <void_type 0x415d4f80 void>
        side-effects tree_0
        arg 0 <addr_expr 0x41758ca0 type <pointer_type 0x41797800>
            constant invariant arg 0 <function_decl 0x41793900 __comp_ctor>>
        arg 1 <tree_list 0x41795618
            value <integer_cst 0x41758c00 constant invariant 0>
            chain <tree_list 0x41795630 value <parm_decl 0x41793d00 t>>>
        arg 2 <var_decl 0x41797900 type <record_type 0x41793200 A>
            addressable QI file t.cc line 5
            size <integer_cst 0x415c7d00 constant invariant 8>
            unit size <integer_cst 0x415c7ca0 constant invariant 1>
            align 8 context <function_decl 0x41793e00 xd>>>>
Comment 6 Mark Mitchell 2004-08-17 21:08:44 UTC
Jason, this is another problem with stabilize_init and friends, so I've assigned
this to you.
Comment 7 GCC Commits 2004-08-25 05:33:12 UTC
Subject: Bug 16851

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	jason@gcc.gnu.org	2004-08-25 05:33:03

Modified files:
	gcc/cp         : ChangeLog tree.c semantics.c 

Log message:
	PR c++/16851
	* tree.c (stabilize_init): See through a COMPOUND_EXPR.
	
	PR c++/15461
	* semantics.c (nullify_returns_r): Replace a DECL_STMT
	for the NRV with an INIT_EXPR.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.152&r2=1.3892.2.153
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.360.4.8&r2=1.360.4.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.381.4.13&r2=1.381.4.14

Comment 8 Andrew Pinski 2004-08-25 06:35:52 UTC
Fixed so far on the 3.4 branch.
Comment 9 GCC Commits 2004-08-28 02:35:17 UTC
Subject: Bug 16851

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jason@gcc.gnu.org	2004-08-28 02:35:15

Modified files:
	gcc/cp         : tree.c ChangeLog 
Added files:
	gcc/testsuite/g++.dg/eh: throw2.C 

Log message:
	PR c++/16851
	* tree.c (stabilize_init): See through a COMPOUND_EXPR.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&r1=1.407&r2=1.408
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4314&r2=1.4315
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/eh/throw2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 10 Andrew Pinski 2004-08-28 10:17:34 UTC
Fixed.