On Tue, Sep 15, 2020 at 12:14 PM Feng Xue OS <f...@os.amperecomputing.com> wrote: > > Add a rule (T)(A) +- (T)(B) -> (T)(A +- B), which works only when (A +- B) > could be folded to a simple value. By this rule, a plusminus-mult-with-convert > expression could be handed over to the rule (A * C) +- (B * C) -> (A +- B).
Please use INTEGRAL_TYPE_P () instead of TREE_CODE == INTEGER_TYPE in all three cases. It's enough to check for INTEGRAL_TYPE_P on one operand, the types_match will take care of the other. OK with those changes. Thanks, Richard. > Bootstrapped/regtested on x86_64-linux and aarch64-linux. > > Feng > --- > 2020-09-15 Feng Xue <f...@os.amperecomputing.com> > > gcc/ > PR tree-optimization/94234 > * match.pd (T)(A) +- (T)(B) -> (T)(A +- B): New simplification. > > gcc/testsuite/ > PR tree-optimization/94234 > * gcc.dg/pr94234-3.c: New test.