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

Re: cse won't pull an expr out of a function call


> check_failed is declared noreturn.  The expression 
> 
> (decl->foo == BLAH ? decl : check_failed(decl, BLAH))->bar
> 
> appears three times.  cse ought to be able to extract it entirely,

cse mainly does its work inside a single basic block.  The expression
you want be be cse'd itself creates multiple basic blocks.
gcse can handle expressions that are scattered about multiple basic
blocks, but it has to be able to recognize them as expressions with
a particular value first, and to be able to move the instructions that
calculate the expression.
You'll have to do a lot of work to get to this point for a conditional
expression like the one you quoted.


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