------- Comment #8 from rguenth at gcc dot gnu dot org 2008-06-22 15:05 ------- If we would disallow struct copies in the gimple IL and instead require a register temporary that we would re-write into SSA form like
struct s temp_struct3; struct s temp_struct2; struct s temp_struct1; struct s temp_struct3.3; struct s temp_struct2.2; struct s temp_struct1.1; struct s r.0; <bb 2>: r.0_1 = r; temp_struct1 ={v} r.0_1; temp_struct1.1_2 = temp_struct1; temp_struct2 ={v} temp_struct1.1_2; temp_struct2.2_3 = temp_struct2; temp_struct3 ={v} temp_struct2.2_3; temp_struct3.3_4 = temp_struct3; <retval> ={v} temp_struct3.3_4; return <retval>; then value-numbering can recognize the redundant copies and we end up with struct s temp_struct3.3; struct s r.0; <bb 2>: r.0_1 = r; <retval> = r.0_1; return <retval>; (and of course with the possibility of out-of-SSA having to deal with overlapping life-ranges of struct-typed SSA names) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14295