From: Richard Biener Date: Fri, 17 Apr 2020 07:19:32 +0000 (+0200) Subject: fix PVS studio reported bugs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a64468a3034dd8e2d0794a5be84b8da544ffe2c3;p=gcc.git fix PVS studio reported bugs 2020-04-17 Richard Biener PR other/94629 * cgraphclones.c (cgraph_node::create_clone): Remove duplicate initialization. * dwarf2out.c (dw_val_equal_p): Fix pasto in dw_val_class_vms_delta comparison. * optabs.c (expand_binop_directly): Fix pasto in commutation check. * tree-ssa-sccvn.c (vn_reference_lookup_pieces): Fix pasto in initialization. --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8bce0ea6146..d2aa482b2e0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2020-04-17 Richard Biener + + PR other/94629 + * cgraphclones.c (cgraph_node::create_clone): Remove duplicate + initialization. + * dwarf2out.c (dw_val_equal_p): Fix pasto in + dw_val_class_vms_delta comparison. + * optabs.c (expand_binop_directly): Fix pasto in commutation + check. + * tree-ssa-sccvn.c (vn_reference_lookup_pieces): Fix pasto in + initialization. + 2020-04-17 Jakub Jelinek PR rtl-optimization/94618 diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index 8f541a28b6e..e4f1c1d4b5e 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -404,7 +404,6 @@ cgraph_node::create_clone (tree new_decl, profile_count prof_count, new_node->tp_first_run = tp_first_run; new_node->tm_clone = tm_clone; new_node->icf_merged = icf_merged; - new_node->merged_comdat = merged_comdat; new_node->thunk = thunk; new_node->unit_id = unit_id; new_node->merged_comdat = merged_comdat; diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 7d270f2a1b5..787340e9279 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -1479,7 +1479,7 @@ dw_val_equal_p (dw_val_node *a, dw_val_node *b) case dw_val_class_vms_delta: return (!strcmp (a->v.val_vms_delta.lbl1, b->v.val_vms_delta.lbl1) - && !strcmp (a->v.val_vms_delta.lbl1, b->v.val_vms_delta.lbl1)); + && !strcmp (a->v.val_vms_delta.lbl2, b->v.val_vms_delta.lbl2)); case dw_val_class_discr_value: return (a->v.val_discr_value.pos == b->v.val_discr_value.pos diff --git a/gcc/optabs.c b/gcc/optabs.c index 8dd351286cd..1456e59ffa7 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1050,7 +1050,7 @@ expand_binop_directly (enum insn_code icode, machine_mode mode, optab binoptab, commutative_p = commutative_optab_p (binoptab); if (commutative_p && GET_MODE (xop0) != xmode0 && GET_MODE (xop1) != xmode1 - && GET_MODE (xop0) == xmode1 && GET_MODE (xop1) == xmode1) + && GET_MODE (xop0) == xmode1 && GET_MODE (xop1) == xmode0) std::swap (xop0, xop1); /* If we are optimizing, force expensive constants into a register. */ diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index fd74809ca6e..238931d3f3e 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -3446,7 +3446,7 @@ vn_reference_lookup_pieces (tree vuse, alias_set_type set, = valueize_refs (shared_lookup_references); vr1.type = type; vr1.set = set; - vr1.set = base_set; + vr1.base_set = base_set; vr1.hashcode = vn_reference_compute_hash (&vr1); if ((cst = fully_constant_vn_reference_p (&vr1))) return cst;