https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94187
Bug ID: 94187 Summary: valgrind error in count_nonzero_bytes ? Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- For this C code: int foo (void) { return *(int *) ""; } I ran the code through a valgrind version of recent gcc trunk, with the compiler flag -O2, and got this: ./gcc.dg/pr68785.c ==49861== Invalid read of size 1 ==49861== at 0xD9CDDD: count_nonzero_bytes(tree_node*, unsigned long, unsigned long, unsigned int*, bool*, bool*, bool*, vr_values const*, ssa_name_limit_t&) (tree-ssa-strlen.c:4891) ==49861== by 0xD9CF17: count_nonzero_bytes(tree_node*, unsigned long, unsigned long, unsigned int*, bool*, bool*, bool*, vr_values const*, ssa_name_limit_t&) (tree-ssa-strlen.c:4801) ==49861== by 0xDA19EE: count_nonzero_bytes (tree-ssa-strlen.c:4920) ==49861== by 0xDA19EE: handle_integral_assign(gimple_stmt_iterator*, bool*, vr_values const*) (tree-ssa-strlen.c:5547) This bug is strongly related to bug # 68785.