You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
analyzer: new warning: -Wanalyzer-div-by-zero (PR analyzer/124217)
gcc/analyzer/ChangeLog:
PR analyzer/124217
* analyzer.opt (Wanalyzer-div-by-zero): New.
* analyzer.opt.urls: Regenerate.
* region-model.cc (class div_by_zero_diagnostic): New.
(region_model::get_gassign_result): Add warning for division by
zero if ctxt is non-null. Bail out on such cases even if ctxt
is null.
* svalue.cc (type_can_have_value_range_p): Also handle frange.
gcc/ChangeLog:
PR analyzer/124217
* doc/invoke.texi: Add -Wanalyzer-div-by-zero.
gcc/testsuite/ChangeLog:
PR analyzer/124217
* c-c++-common/analyzer/divide-by-zero-1.c: Update to expect
-Wanalyzer-div-by-zero.
* c-c++-common/analyzer/divide-by-zero-pr124195-2.c: Likewise.
* gcc.dg/analyzer/data-model-1.c (test_21): Split out division by
zero cases into...
(test_21_division_by_zero): ...this, and...
(test_21_modulus_by_zero): ...this, updating these to expect
-Wanalyzer-div-by-zero warnings.
* gcc.dg/analyzer/divide-by-zero-float.c: New test.
* gcc.dg/analyzer/divide-by-zero-ice-pr124433.c: Update to expect
-Wanalyzer-div-by-zero.
* gcc.dg/analyzer/divide-by-zero-pr124195-1.c: Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
0 commit comments