https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99122
--- Comment #14 from Martin Jambor <jamborm at gcc dot gnu.org> --- Like with the following, which seems to work as far as inlining is concerned, but the latest Jakub's example ICEs when cloning for IPA-CP :-/ (I am also not sure if the predicate to identify VLAs is the best one). --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -3418,6 +3418,9 @@ force_value_to_type (tree type, tree value) Still if we end up with truly mismatched types here, fall back to using a VIEW_CONVERT_EXPR or a literal zero to not leak invalid GIMPLE to the following passes. */ + if (TREE_CODE (value) == WITH_SIZE_EXPR) + value = TREE_OPERAND (value, 0); + if (!is_gimple_reg_type (TREE_TYPE (value)) || TYPE_SIZE (type) == TYPE_SIZE (TREE_TYPE (value))) return fold_build1 (VIEW_CONVERT_EXPR, type, value); @@ -4017,6 +4020,10 @@ inline_forbidden_p (tree fndecl) wi.info = (void *) fndecl; wi.pset = &visited_nodes; + for (tree parm = DECL_ARGUMENTS (fndecl); parm; parm = DECL_CHAIN (parm)) + if (TREE_CODE (DECL_SIZE (parm)) != INTEGER_CST) + return true; + FOR_EACH_BB_FN (bb, fun) { gimple *ret;