https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78716
Bug ID: 78716 Summary: [7 Regression] ICE in gimplify_va_arg_expr, at gimplify.c:12650 (i686-linux-gnu) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: doko at gcc dot gnu.org Target Milestone: --- Created attachment 40277 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40277&action=edit preprocessed source seen with -r on i686-linux-gnu with all optimization levels: $ cat ttuple.ii template <typename = int, typename = int, typename = int, typename = int, typename = int> struct a; template <typename> struct b; template <typename = int, typename d = void> class e : b<d>::c { public: typedef e f; typedef typename b<d>::c g; e(__builtin_va_list *s) : g(__builtin_va_arg(*s, int)) {} }; template <> struct b<void> { typedef e<> c; }; template <> struct e<> { template <typename h> e(h); }; template <typename i> class a<i> : public e<i> {}; template <typename i, typename j, typename k, typename l> class a<i, j, k, l> : e<typename a<j>::f> { public: template <typename m, typename n, typename o, typename p> a(a<m, n, o, p>) : a::f(0) {} }; template <typename i, typename j, typename k, typename l> a<> r(i, j, k, l); void q() { a<float, float>(r(4, 6, 9, 7)); } $ g++ -c -O0 ttuple.ii ttuple.ii: In constructor 'e< <template-parameter-1-1>, d>::e(char**) [with <template-parameter-1-1> = e<float, void>; d = void]': ttuple.ii:9:56: internal compiler error: in gimplify_va_arg_expr, at gimplify.c:12650 e(__builtin_va_list *s) : g(__builtin_va_arg(*s, int)) {} ^ 0x852820c gimplify_va_arg_expr(tree_node**, gimple**, gimple**) ../../src/gcc/gimplify.c:12650 0x8524e36 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../src/gcc/gimplify.c:11256 0x852cf86 gimplify_expr ../../src/gcc/gimplify.c:12181 0x852e30c gimplify_call_expr ../../src/gcc/gimplify.c:3242 0x8525af3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../src/gcc/gimplify.c:11155 0x8527be9 gimplify_stmt(tree_node**, gimple**) ../../src/gcc/gimplify.c:6459 0x8525a4b gimplify_cleanup_point_expr ../../src/gcc/gimplify.c:6210 0x8525a4b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../src/gcc/gimplify.c:11559 0x8527be9 gimplify_stmt(tree_node**, gimple**) ../../src/gcc/gimplify.c:6459 0x8528622 gimplify_bind_expr ../../src/gcc/gimplify.c:1276 0x8525b45 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../src/gcc/gimplify.c:11383 0x8527be9 gimplify_stmt(tree_node**, gimple**) ../../src/gcc/gimplify.c:6459 0x8528eb2 gimplify_body(tree_node*, bool) ../../src/gcc/gimplify.c:12377 0x8529265 gimplify_function_tree(tree_node*) ../../src/gcc/gimplify.c:12534 0x83f1608 cgraph_node::analyze() ../../src/gcc/cgraphunit.c:626 0x83f3c00 analyze_functions ../../src/gcc/cgraphunit.c:1087 0x83f4660 symbol_table::finalize_compilation_unit() ../../src/gcc/cgraphunit.c:2562 Please submit a full bug report, with preprocessed source if appropriate.