Index: tree-sra.c =================================================================== --- tree-sra.c (revision 123979) +++ tree-sra.c (working copy) @@ -2523,25 +2523,17 @@ scalarize_use (struct sra_elt *elt, tree a structure is passed as more than one argument to a function call. This optimization would be most effective if sra_walk_function processed the blocks in dominator order. */ - - generate_copy_inout (elt, false, generate_element_ref (elt), &list); - if (list) + generate_copy_inout (elt, is_output, generate_element_ref (elt), &list); + if (list == NULL) + return; + mark_all_v_defs (list); + if (is_output) + sra_insert_after (bsi, list); + else { - mark_all_v_defs (list); sra_insert_before (bsi, list); mark_no_warning (elt); } - - if (is_output) - { - list = NULL; - generate_copy_inout (elt, true, generate_element_ref (elt), &list); - if (list) - { - mark_all_v_defs (list); - sra_insert_after (bsi, list); - } - } } }