[Bug rtl-optimization/49330] Integer arithmetic on addresses optimised with pointer arithmetic rules

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 9 11:05:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49330

--- Comment #20 from Richard Biener <rguenth at gcc dot gnu.org> ---
For stage3/gcc/*.o statistics show we perform 21051052 base_alias_check calls
and in the end 706852 times it is the one that would have disambiguated
things compared to if we remove it (thus as if we do base_alias_check last).

Note there's also

  base = find_base_term (x_addr);
  if (base && (GET_CODE (base) == LABEL_REF
               || (GET_CODE (base) == SYMBOL_REF
                   && CONSTANT_POOL_ADDRESS_P (base))))
    return 0;

which is suspicious but I guess harder to hit in practice so things go wrong.

base_alias_check is not exactly the first thing we check (but nearly) so
we'd roughly lose 3% disambiguations from RTL alias analysis if we scrap
base_alias_check completely.

That's probably too much.

Note the CONSTANT_POOL_ADDRESS_P thing isn't necessary and subsumed by
following checks so we could remove that without losing anything
(it hits only 84 times at all in the above set and later checks subsume it).


More information about the Gcc-bugs mailing list