https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103121
--- Comment #11 from Andrew Macleod <amacleod at redhat dot com> --- (In reply to Martin Sebor from comment #10) > Sorry, I've been having trouble with GDB and so I'm running two GDB sessions > and I have been mixing output from both of them. I see the warning for the > store to *_23 in BB 13, not for BB 12. Here's a fresh session as a sanity > check: > > > Breakpoint 1, strlen_pass::maybe_warn_overflow (this=0x7fffffffd880, > stmt=0x7ffff4c2eb40, call_lhs=true, len=1, si=0x0, plus_one=false, > rawmem=false) at /src/gcc/master/gcc/tree-ssa-strlen.c:2181 > 2181 tree tlen = build_int_cst (size_type_node, len); > (gdb) p debug(gimple_bb(stmt)) > <bb 13> [local count: 105119324]: > _23 = grp_name_37 + idx_47; > *_23 = 0; > if (diff_seen_24 != 0) > goto <bb 15>; [100.00%] > else > goto <bb 14>; [0.00%] > > $3 = void > (gdb) c > Continuing. > ../../gcc/gcc/cp/optimize.c: In function 'tree_node* > cdtor_comdat_group(tree, tree)': > ../../gcc/gcc/cp/optimize.c:208:17: warning: writing 1 byte into a region of > size 0 [-Wstringop-overflow=] > ../../gcc/gcc/cp/optimize.c:191:40: note: at offset 1 into destination > object of size 1 allocated by '__builtin_alloca' > [Inferior 1 (process 11409) exited normally] Im still not sure what you are asking, or think is wrong. I don't see any ranges here. Presumably the range of _4 is [0,0][2,+INF] at this point since we've take the other branch. If you haven't switched to multi-ranges and are still using value_range, then presumably you would see ~[1,1] Which means its possible that _4 was 0 on this branch, which also means the warning would trigger? The way the IL reads, if _1 is MAX_INT, then _4 is 0, and that gets through on the 4->16 edge... Am I missing something?