Bug 60869 - ICE on throw after invalid definition of __cxa_throw
Summary: ICE on throw after invalid definition of __cxa_throw
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.9.0
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2014-04-16 22:16 UTC by Harald van Dijk
Modified: 2019-06-06 22:15 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-04-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald van Dijk 2014-04-16 22:16:28 UTC
typedef void __cxa_throw(void *, void *,  void (*) (void *));
void f() { throw 1; }

gives

unhandled expression in get_expr_operands():
 <type_decl 0x7f9eadd508a0 __cxa_throw
    type <function_type 0x7f9eadd53d20 __cxa_throw
        type <void_type 0x7f9eadb9c000 void VOID
            align 8 symtab 0 alias set -1 canonical type 0x7f9eadb9c000
            pointer_to_this <pointer_type 0x7f9eadb9c0a8>>
        QI
        size <integer_cst 0x7f9eadb8b280 constant 8>
        unit size <integer_cst 0x7f9eadb8b2a0 constant 1>
        align 8 symtab 0 alias set -1 canonical type 0x7f9eadd53c78
        arg-types <tree_list 0x7f9eadd63050 value <pointer_type 0x7f9eadb9c0a8>
            chain <tree_list 0x7f9eadd63078 value <pointer_type 0x7f9eadb9c0a8>
                chain <tree_list 0x7f9eadd630a0 value <pointer_type 0x7f9eadbaa498>
                    chain <tree_list 0x7f9eadb87b18 value <void_type 0x7f9eadb9c000 void>>>>>
        pointer_to_this <pointer_type 0x7f9eadd65498>>
    VOID file test2.cc line 1 col 14
    align 1 context <translation_unit_decl 0x7f9eadb93170 D.1>
    result <function_type 0x7f9eadd53c78 type <void_type 0x7f9eadb9c000 void>
        QI size <integer_cst 0x7f9eadb8b280 8> unit size <integer_cst 0x7f9eadb8b2a0 1>
        align 8 symtab 0 alias set -1 canonical type 0x7f9eadd53c78 arg-types <tree_list 0x7f9eadd63050>
        pointer_to_this <pointer_type 0x7f9eadd65540>> chain <function_decl 0x7f9eadd4e600 __cxa_call_unexpected>>

test2.cc: In function ‘void f()’:
test2.cc:2:21: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:902
 void f() { throw 1; }
                     ^
0xcc445c get_expr_operands
        ../../gcc/gcc/tree-ssa-operands.c:902
0xcc4cd1 parse_ssa_operands
        ../../gcc/gcc/tree-ssa-operands.c:951
0xcc620a build_ssa_operands
        ../../gcc/gcc/tree-ssa-operands.c:966
0xcc620a update_stmt_operands(function*, gimple_statement_base*)
        ../../gcc/gcc/tree-ssa-operands.c:1103
0xbf75e8 update_stmt
        ../../gcc/gcc/gimple-ssa.h:144
0xbf75e8 mark_def_sites
        ../../gcc/gcc/tree-into-ssa.c:675
0xbf75e8 mark_def_dom_walker::before_dom_children(basic_block_def*)
        ../../gcc/gcc/tree-into-ssa.c:2253
0x1044937 dom_walker::walk(basic_block_def*)
        ../../gcc/gcc/domwalk.c:177
0xbf6191 rewrite_into_ssa
        ../../gcc/gcc/tree-into-ssa.c:2331
0xbf6191 execute
        ../../gcc/gcc/tree-into-ssa.c:2403
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Sort of expected, this ICEs on every version of GCC I can test right now (release versions of 4.1.2 to 4.8.2, and 4.9 as of about a month ago)
Comment 1 Harald van Dijk 2019-06-06 22:15:50 UTC
This is fixed in GCC 9, which gives:

  error: '__cxa_throw' declared incorrectly