https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111324
--- Comment #5 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #2) > Confirmed. > > So using the local range in this case is ok. There might be only a few times > we don't want to use it though in match. Agree, "get_range_query" would be more useful for most cases. Through a quick look at match.pd, there are another two patterns that use "get_global_range_query". Some concerns about those patterns, so those patterns may not need to be updated. * (T)(A)+cst -->(T)(A+cst): I'm wondering if this transformation is really in favor of PPC. e.g. "return (long) x1 + 40;" could save one "extend-insn" less than "return (long)(x1 + 40);" * For pattern "((x * cst) + cst1) * cst2": it seems this pattern does not affect any cases. I mean this optimization is done by other parts (before match.pd).