[Bug tree-optimization/91090] New: A suspicious code in tree-ssa-dom.c
fxue at os dot amperecomputing.com
gcc-bugzilla@gcc.gnu.org
Fri Jul 5 04:59:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91090
Bug ID: 91090
Summary: A suspicious code in tree-ssa-dom.c
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: fxue at os dot amperecomputing.com
Target Milestone: ---
Find code snippet in simplify_stmt_for_jump_threading ():
if (vr->kind () == VR_RANGE)
{
size_t i, j;
find_case_label_range (switch_stmt, vr->min (), vr->max (), &i, &j);
if (i == j)
{
tree label = gimple_switch_label (switch_stmt, i);
tree singleton;
if (CASE_HIGH (label) != NULL_TREE
? (tree_int_cst_compare (CASE_LOW (label), vr->min ()) <= 0
&& tree_int_cst_compare (CASE_HIGH (label), vr->max ()) >=
0)
: (vr->singleton_p (&singleton)
&& tree_int_cst_equal (CASE_LOW (label), singleton)))
return label;
if (i > j)
return gimple_switch_label (switch_stmt, 0);
}
}
The conditional "if (i > j)" should be outside of "if (i == j)"?
More information about the Gcc-bugs
mailing list