------- Comment #7 from jakub at gcc dot gnu dot org 2007-12-13 23:10 ------- Created an attachment (id=14748) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14748&action=view) hack
What I meant is roughly this. Except that this has horrible code duplication with gimplify_init_ctor and so wouldn't be really maintanable, so take it just as a proof of concept. For aggregates this optimization wouldn't be done if gimplify_init_ctor later loads it from memory anyway, or if it would try to change *to_p into TREE_STATIC (the latter is what breaks the inliner), for vectors/complex it would accept it always. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34448