This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/70171] Poor code generated when return struct using ternary operator


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?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]