------- Comment #8 from rguenth at gcc dot gnu dot org 2009-01-24 09:22 ------- Smaller testcase:
struct Empty { Empty() {} }; struct Other { Other(const Empty& e_) : e(e_) {} Empty e; }; void bar(Other&); void foo() { Empty e; Other o(e); bar(o); } RTL expansion removes the assignment, so we should be able to use the same reasoning to disable the warning and/or to get rid of the assignment on the tree level. RTL uses expr_size() here, which yields const0_rtx for e and o. As this involves a langhook I think the correct thing is to fix the missed-optimization and remove these stores during gimplification (or from within the frontend, of course). -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lopezibanez at gmail dot | |com, rguenth at gcc dot gnu | |dot org Priority|P2 |P1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38851