This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/70171] Poor code generated when return struct using ternary operator
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 Mar 2016 10:11:28 +0000
- Subject: [Bug tree-optimization/70171] Poor code generated when return struct using ternary operator
- Auto-submitted: auto-generated
- References: <bug-70171-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70171
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Btw, the C frontend produces optimized code here - it simply uses
return select != 0 ? a : b;
in its GENERIC. Maybe the C++ FE can avoid building a TARGET_EXPR like that
or use
return <retval> = TARGET_EXPR <D.2294, select ? a : b>
that is, without going through the address-taking and dereferencing game?