https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65802
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to vries from comment #6) > (In reply to vries from comment #5) > > So the question is: should ifn_va_arg have ECF_NOTHROW? > > Adding ECF_NOTHROW to ifn_va_arg also fixes the ICE. > > And at gimplify_va_arg_expr, the VA_ARG_EXPR tree is non-throwing: Is that always the case (try -fnon-call-exceptions)? Then doing that looks obvious. Richard. > (gdb) call debug_generic_expr (*expr_p ) > VA_ARG_EXPR <c> > (gdb) call debug_tree (*expr_p ) > <va_arg_expr 0x7ffff661e9a0 > type <pointer_type 0x7ffff64c97e0 > type <integer_type 0x7ffff64a7690 int public SI > size <integer_cst 0x7ffff64c50a8 constant 32> > unit size <integer_cst 0x7ffff64c50c0 constant 4> > align 32 symtab 0 alias set -1 canonical type 0x7ffff64a7690 > precision 32 min <integer_cst 0x7ffff64c5060 -2147483648> max <integer_cst > 0x7ffff64c5078 2147483647> > pointer_to_this <pointer_type 0x7ffff64c97e0>> > sizes-gimplified unsigned DI > size <integer_cst 0x7ffff64a3e58 constant 64> > unit size <integer_cst 0x7ffff64a3e70 constant 8> > align 64 symtab 0 alias set -1 canonical type 0x7ffff64c97e0 > pointer_to_this <pointer_type 0x7ffff6622540>> > side-effects > arg 0 <var_decl 0x7ffff64b0c60 c > type <array_type 0x7ffff64ccbd0 __builtin_va_list type <record_type > 0x7ffff64cc738 __va_list_tag> > sizes-gimplified BLK > size <integer_cst 0x7ffff64c5318 constant 192> > unit size <integer_cst 0x7ffff64c52e8 constant 24> > align 64 symtab 0 alias set -1 canonical type 0x7ffff64cc888 > domain <integer_type 0x7ffff64cc7e0>> > used tree_1 decl_5 BLK file test.cc line 13 col 25 size <integer_cst > 0x7ffff64c5318 192> unit size <integer_cst 0x7ffff64c52e8 24> > align 64 context <function_decl 0x7ffff66240d8 fn1>> > test.cc:15:32> > (gdb) call tree_could_throw_p (*expr_p ) > $1 = false > ... > > I'll bootstrap and reg-test this fix.