A static checker determined that LTO def_fn_type has erratic va_start/end combinations on error paths. The following fixes that.
Bootstrap and regtest running on x86_64-unknown-linux-gnu. Richard. 2014-08-14 Richard Biener <rguent...@suse.de> * lto-lang.c (def_fn_type): Fix error handling wrt va_end. Index: gcc/lto/lto-lang.c =================================================================== --- gcc/lto/lto-lang.c (revision 213958) +++ gcc/lto/lto-lang.c (working copy) @@ -524,6 +524,7 @@ def_fn_type (builtin_type def, builtin_t tree *args = XALLOCAVEC (tree, n); va_list list; int i; + bool err = false; va_start (list, n); for (i = 0; i < n; ++i) @@ -531,22 +532,22 @@ def_fn_type (builtin_type def, builtin_t builtin_type a = (builtin_type) va_arg (list, int); t = builtin_types[a]; if (t == error_mark_node) - goto egress; + err = true; args[i] = t; } va_end (list); t = builtin_types[ret]; + if (err) + t = error_mark_node; if (t == error_mark_node) - goto egress; - if (var) + ; + else if (var) t = build_varargs_function_type_array (t, n, args); else t = build_function_type_array (t, n, args); - egress: builtin_types[def] = t; - va_end (list); } /* Used to help initialize the builtin-types.def table. When a type of