https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127101
Bug ID: 127101
Summary: a+b when b is non-zero and it is known there is no
overflow (due to a check) implies a+b is non-zero
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Blocks: 85316
Target Milestone: ---
Created attachment 65431
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65431&action=edit
testcase
Take the attached testcase. Both of these functions should reduce to just
return 1;
I think this comes from std::vector::_M_check_len but I am not 100% sure.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85316
[Bug 85316] [meta-bug] VRP range propagation missed cases