https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120629
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amacleod at redhat dot com --- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> --- In #c16 testcase I see in optimized dump with alias: # RANGE [irange] unsigned int [1, 9] MASK 0xf VALUE 0x0 _46 = (unsigned int) ivtmp.24_52; _I_lsm.20_47 = __gcov0._ZN13ipa_predicate9stream_inEP15lto_input_block[3]; # RANGE [irange] unsigned int [0, 7] _54 = 8 - _46; # RANGE [irange] sizetype [0, 7] MASK 0x7 VALUE 0x0 _55 = (sizetype) _54; # RANGE [irange] sizetype [1, 8] MASK 0xf VALUE 0x0 _56 = _55 + 1; # RANGE [irange] sizetype [4, 32] MASK 0x3c VALUE 0x0 _57 = _56 * 4; # RANGE [irange] sizetype [1, 8] MASK 0xf VALUE 0x0 _58 = (sizetype) k_10; # RANGE [irange] sizetype [4, 32] MASK 0x3c VALUE 0x0 _59 = _58 * 4; # PT = anything _60 = this_11(D) + _59; # USE = anything # CLB = anything __builtin_memset (_60, 0, _57); and during RTL expansion of __builtin_memset we reach determine_block_size which does int_range_max r; tree tmin, tmax; gimple *cg = currently_expanding_gimple_stmt; get_range_query (cfun)->range_of_expr (r, len, cg); range_type = get_legacy_range (r, tmin, tmax); But, somehow instead of returning the [4, 32] range it returns [32, 32].