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

--- Comment #1 from Alex Coplan <acoplan at gcc dot gnu.org> ---
For the related:

void a() {
  __builtin_memset(a + 0x7fffffffffffffff, 0, 3);
}

we see a similar problem to PR100201 in tree-ssa-alias.c:

$ gcc/xgcc -B gcc alias_test.c -c -O
/home/alecop01/toolchain/src/gcc/gcc/poly-int.h:1107:5: runtime error: signed
integer overflow: 8 * 9223372036854775807 cannot be represented in type 'long
int'
    #0 0x2391e74 in poly_int<2u, poly_result<if_nonpoly<int, int,
poly_int_traits<int>::is_poly>::type, long,
poly_coeff_pair_traits<if_nonpoly<int, int,
poly_int_traits<int>::is_poly>::type, long>::result_kind>::type> operator*<2u,
int, long>(int const&, poly_int_pod<2u, long> const&)
/home/alecop01/toolchain/src/g
cc/gcc/poly-int.h:1107
    #1 0x2391e74 in ao_ref_init_from_ptr_and_range
/home/alecop01/toolchain/src/gcc/gcc/tree-ssa-alias.c:810
    #2 0x2396bc0 in ao_ref_init_from_ptr_and_size(ao_ref*, tree_node*,
tree_node*) /home/alecop01/toolchain/src/gcc/gcc/tree-ssa-alias.c:852
    #3 0x24359ec in initialize_ao_ref_for_dse
/home/alecop01/toolchain/src/gcc/gcc/tree-ssa-dse.c:115
    #4 0x24359ec in initialize_ao_ref_for_dse
/home/alecop01/toolchain/src/gcc/gcc/tree-ssa-dse.c:97
    #5 0x243bbd0 in dse_dom_walker::dse_optimize_stmt(gimple_stmt_iterator*)
/home/alecop01/toolchain/src/gcc/gcc/tree-ssa-dse.c:1064
    #6 0x243dfb4 in dse_dom_walker::before_dom_children(basic_block_def*)
/home/alecop01/toolchain/src/gcc/gcc/tree-ssa-dse.c:1183
    #7 0x498238c in dom_walker::walk(basic_block_def*)
/home/alecop01/toolchain/src/gcc/gcc/domwalk.c:309
    #8 0x2432b24 in execute
/home/alecop01/toolchain/src/gcc/gcc/tree-ssa-dse.c:1237
    #9 0x1b5ec1c in execute_one_pass(opt_pass*)
/home/alecop01/toolchain/src/gcc/gcc/passes.c:2567
    #10 0x1b623b8 in execute_pass_list_1
/home/alecop01/toolchain/src/gcc/gcc/passes.c:2656
    #11 0x1b623f0 in execute_pass_list_1
/home/alecop01/toolchain/src/gcc/gcc/passes.c:2657
    #12 0x1b624d4 in execute_pass_list(function*, opt_pass*)
/home/alecop01/toolchain/src/gcc/gcc/passes.c:2667
    #13 0x1b557b0 in do_per_function_toporder(void (*)(function*, void*),
void*) /home/alecop01/toolchain/src/gcc/gcc/passes.c:1773
    #14 0x1b6385c in do_per_function_toporder(void (*)(function*, void*),
void*) /home/alecop01/toolchain/src/gcc/gcc/plugin.h:191
    #15 0x1b6385c in execute_ipa_pass_list(opt_pass*)
/home/alecop01/toolchain/src/gcc/gcc/passes.c:3001
    #16 0xc801bc in ipa_passes
/home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:2156
    #17 0xc801bc in symbol_table::compile()
/home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:2291
    #18 0xc8b81c in symbol_table::compile()
/home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:2271
    #19 0xc8b81c in symbol_table::finalize_compilation_unit()
/home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:2539
    #20 0x1f97478 in compile_file
/home/alecop01/toolchain/src/gcc/gcc/toplev.c:482
    #21 0x68d9b0 in do_compile
/home/alecop01/toolchain/src/gcc/gcc/toplev.c:2201
    #22 0x68d9b0 in toplev::main(int, char**)
/home/alecop01/toolchain/src/gcc/gcc/toplev.c:2340
    #23 0x6910d0 in main /home/alecop01/toolchain/src/gcc/gcc/main.c:39
    #24 0xffffae6cc6dc in __libc_start_main
(/lib/aarch64-linux-gnu/libc.so.6+0x206dc)
    #25 0x691b2c  (/data/alecop01/builds/bstrap-ubsan/gcc/cc1+0x691b2c)

Reply via email to