public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/23372] [4.0/4.1 Regression] Temporary aggregate copy not elided when passing parameters by value Date: Mon, 29 Aug 2005 13:15:00 -0000 [thread overview] Message-ID: <20050829131319.27957.qmail@sourceware.org> (raw) In-Reply-To: <20050813080257.23372.guillaume.melquiond@ens-lyon.fr> ------- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-29 13:13 ------- One possibility would be to hack out-of-ssa to coalesce single use variables with their defs in the case of aggregates. The real fix would involve expanding to rtl from ssa, so we have this information ready and need not create these useless memcpy's. Or whatever solution is more "correct" here ("fixing" the frontends will not work for the second testcase until we allow function calls as arguments in gimple). Anyway, here's the hack that passed bootstrapping and regtesting for C and C++ with only some tr1 tests failing: Index: gimplify.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/gimplify.c,v retrieving revision 2.113.2.11 diff -c -3 -p -r2.113.2.11 gimplify.c *** gimplify.c 16 Aug 2005 22:16:52 -0000 2.113.2.11 --- gimplify.c 29 Aug 2005 12:04:33 -0000 *************** gimplify_target_expr (tree *expr_p, tree *** 3628,3633 **** --- 3628,3641 ---- if (init) { + /* Try to avoid the temporary if possible. */ + if (TREE_CODE (init) == INDIRECT_REF + && !TARGET_EXPR_CLEANUP (targ)) + { + *expr_p = init; + return GS_OK; + } + /* TARGET_EXPR temps aren't part of the enclosing block, so add it to the temps list. */ gimple_add_tmp_var (temp); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23372
next prev parent reply other threads:[~2005-08-29 13:13 UTC|newest] Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-08-13 8:03 [Bug c++/23372] New: " guillaume dot melquiond at ens-lyon dot fr 2005-08-13 14:17 ` [Bug c++/23372] " rguenth at tat dot physik dot uni-tuebingen dot de 2005-08-13 16:48 ` fang at csl dot cornell dot edu 2005-08-13 17:57 ` [Bug c++/23372] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org 2005-08-13 18:00 ` giovannibajo at libero dot it 2005-08-13 18:11 ` rguenth at tat dot physik dot uni-tuebingen dot de 2005-08-13 18:13 ` pinskia at gcc dot gnu dot org 2005-08-13 18:16 ` rguenth at tat dot physik dot uni-tuebingen dot de 2005-08-13 21:21 ` rguenth at gcc dot gnu dot org 2005-08-14 6:45 ` guillaume dot melquiond at ens-lyon dot fr 2005-08-26 14:59 ` rguenth at gcc dot gnu dot org 2005-08-26 17:40 ` guillaume dot melquiond at ens-lyon dot fr 2005-08-29 12:33 ` rguenth at gcc dot gnu dot org 2005-08-29 13:15 ` rguenth at gcc dot gnu dot org [this message] 2005-09-14 6:36 ` pinskia at gcc dot gnu dot org 2005-09-27 16:21 ` mmitchel at gcc dot gnu dot org [not found] <bug-23372-7904@http.gcc.gnu.org/bugzilla/> 2005-10-16 22:20 ` pinskia at gcc dot gnu dot org 2005-10-31 5:00 ` mmitchel at gcc dot gnu dot org 2006-01-31 15:24 ` pinskia at gcc dot gnu dot org 2006-01-31 16:03 ` rguenth at gcc dot gnu dot org 2006-01-31 16:05 ` pinskia at gcc dot gnu dot org 2006-01-31 16:05 ` pinskia at gcc dot gnu dot org 2006-02-02 9:16 ` rguenth at gcc dot gnu dot org 2006-02-02 17:16 ` sje at cup dot hp dot com 2006-02-03 1:49 ` hp at gcc dot gnu dot org 2006-02-03 9:16 ` rguenth at gcc dot gnu dot org 2006-02-07 15:36 ` rguenth at gcc dot gnu dot org 2006-08-23 14:23 ` jason at gcc dot gnu dot org 2006-08-23 14:23 ` jason at gcc dot gnu dot org 2006-08-23 14:34 ` jason at gcc dot gnu dot org 2006-10-07 3:49 ` pinskia at gcc dot gnu dot org 2006-10-07 6:16 ` pinskia at gcc dot gnu dot org [not found] <bug-23372-4@http.gcc.gnu.org/bugzilla/> 2011-03-18 15:07 ` jason at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20050829131319.27957.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).