fix PVS studio reported bugs
authorRichard Biener <rguenther@suse.de>
Fri, 17 Apr 2020 07:19:32 +0000 (09:19 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 17 Apr 2020 08:38:45 +0000 (10:38 +0200)
2020-04-17  Richard Biener  <rguenther@suse.de>

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.

gcc/ChangeLog
gcc/cgraphclones.c
gcc/dwarf2out.c
gcc/optabs.c
gcc/tree-ssa-sccvn.c

index 8bce0ea61469f517d486cf7b9f456075f70de9eb..d2aa482b2e081dc2f3e0eb2f68c6d43eab205068 100644 (file)
@@ -1,3 +1,15 @@
+2020-04-17  Richard Biener  <rguenther@suse.de>
+
+       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  <jakub@redhat.com>
 
        PR rtl-optimization/94618
index 8f541a28b6ec5ca922dbbc26d0e3de9ffb87b88f..e4f1c1d4b5ebbf8549d52ac19a3d1d9887242070 100644 (file)
@@ -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;
index 7d270f2a1b50cd1db731170ea2ac212f9a09e315..787340e92793a9b70b53b04c900bf4f1f2d29e44 100644 (file)
@@ -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
index 8dd351286cd1eb69255f4a3c48308faecf1fc3e2..1456e59ffa7eba12d0d2ae10862038cb4ea4b00e 100644 (file)
@@ -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.  */
index fd74809ca6ea0cd3d69016b9307f271c4c01f041..238931d3f3e8c4f860c62f1b10fc4edf3732133f 100644 (file)
@@ -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;