Index: tree-inline.c =================================================================== --- tree-inline.c (revision 114740) +++ tree-inline.c (working copy) @@ -1081,6 +1081,8 @@ setup_one_parameter (copy_body_data *id, if (rhs == error_mark_node) return; + + STRIP_USELESS_TYPE_CONVERSION (rhs); /* We want to use MODIFY_EXPR, not INIT_EXPR here so that we keep our trees in gimple form. */ @@ -1267,6 +1269,8 @@ declare_return_variable (copy_body_data use = var; if (!lang_hooks.types_compatible_p (TREE_TYPE (var), caller_type)) use = fold_convert (caller_type, var); + + STRIP_USELESS_TYPE_CONVERSION (use); done: /* Register the VAR_DECL as the equivalent for the RESULT_DECL; that Index: testsuite/gcc.dg/tree-ssa/inline-1.c =================================================================== --- testsuite/gcc.dg/tree-ssa/inline-1.c (revision 0) +++ testsuite/gcc.dg/tree-ssa/inline-1.c (revision 0) @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-final_cleanup" } */ + + +typedef struct { + double min; + double max; +} interval; +inline interval add(interval x, interval y) __attribute__((always_inline)); +inline interval add(interval x, interval y) +{ + interval r; + r.min = x.min + y.min; + r.max = x.max + y.max; + return r; +} +interval foo (interval a, interval b, interval c) +{ + return add (a, add (b, c)); +} + + +/* { dg-final { scan-tree-dump-times "\(struct interval\)" 0 "final_cleanup"} } */ +/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ +