]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/27800 - avoid unnecessary temporary during gimplification
authorRichard Biener <rguenther@suse.de>
Tue, 20 Feb 2024 10:47:03 +0000 (11:47 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 7 May 2024 12:19:35 +0000 (14:19 +0200)
commitbed6ec161be8c5ca2f24195900ce3c9b81c3e141
tree7dd43e3a58257f3146d570a8b226fa6b4625eb06
parentcc2f3e408ee095653e6658b3126efce717a5586e
middle-end/27800 - avoid unnecessary temporary during gimplification

This avoids a tempoary when gimplifying reg = a ? b : c, re-using
the LHS of an assignment if that's a register.

PR middle-end/27800
* gimplify.cc (gimplify_modify_expr_rhs): For a COND_EXPR
avoid a temporary from gimplify_cond_expr when the LHS is
a register by pushing the assignment into the COND_EXPR arms.

* gcc.dg/pr27800.c: New testcase.
gcc/gimplify.cc
gcc/testsuite/gcc.dg/pr27800.c [new file with mode: 0644]