https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92409
--- Comment #11 from Martin Jambor <jamborm at gcc dot gnu.org> --- (In reply to Richard Biener from comment #8) > @@ -3634,6 +3636,10 @@ declare_return_variable (copy_body_data > && !DECL_GIMPLE_REG_P (result) > && DECL_P (var)) > DECL_GIMPLE_REG_P (var) = 0; > + > + if (!useless_type_conversion_p (callee_type, caller_type)) > + var = build1 (VIEW_CONVERT_EXPR, callee_type, var); > + > use = NULL; > goto done; > } OK, but please note that the callee_type and caller_type have different sizes here: (gdb) pt callee_type <integer_type 0x7ffff76bc5e8 int public SI size <integer_cst 0x7ffff76a3cd8 type <integer_type 0x7ffff76bc0a8 bitsizetype> constant 32>... (gdb) pt caller_type <record_type 0x7ffff77c7dc8 str_t type_0 BLK size <integer_cst 0x7ffff76c11b0 type <integer_type 0x7ffff76bc0a8 bitsizetype> constant 96>... ...so you are creating a size-mismatched V_C_E. Don't you want to use force_value_to_type instead?