This is the mail archive of the gcc-patches@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]

Re: [PATCH] Fix middle-end/30132: ICE with complex and taking the real part of a ?:


Andrew Pinski wrote:
       * typeck.c (build_address): For COND_EXPR, create a?&b:&c instead
       of the plain &(a?b:c) so we don't get a temp variable in the gimplifier.

What about the other transformations in unary_complex_lvalue? Or the &* optimization?


The problem is that build_address is trying to do something very simple, but the name makes it attractive to other parts of the compiler that want the address of something without all the diagnostics in build_unary_op. Really it's only safe to call build_address if you know that there aren't any tree simplifications to be done on the operand.

I think what we really need is to split out most of the address handling in build_unary_op so we can call it with diagnostics on or off, call the latter build_address, rename the current build_address to build_addr_expr and go through the callers of build_address to see which one they really want.

Jason


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