re PR c/84873 (ICE: verify_ssa failed (error: definition in block 3 does not dominate...
authorRichard Biener <rguenther@suse.de>
Fri, 16 Mar 2018 12:04:29 +0000 (12:04 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 16 Mar 2018 12:04:29 +0000 (12:04 +0000)
2018-03-16  Richard Biener  <rguenther@suse.de>

PR c/84873
* c-gimplify.c (c_gimplify_expr): Revert previous change.  Instead
unshare the possibly folded expression.

From-SVN: r258591

gcc/c-family/ChangeLog
gcc/c-family/c-gimplify.c

index a03ff86e57b31d6d6753622a369d3ee5f70a0803..a54d44eb6f3a1af123b31937420b557e9c1faff7 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-16  Richard Biener  <rguenther@suse.de>
+
+       PR c/84873
+       * c-gimplify.c (c_gimplify_expr): Revert previous change.  Instead
+       unshare the possibly folded expression.
+
 2018-03-15  Richard Biener  <rguenther@suse.de>
 
        PR c/84873
index e6b90ef95b6123c25e0fbfb3c2d024de9a85a7a7..faaf22e18a708852602cbeec21743646b509600e 100644 (file)
@@ -245,15 +245,9 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
                                    unsigned_type_node)
            && !types_compatible_p (TYPE_MAIN_VARIANT (TREE_TYPE (*op1_p)),
                                    integer_type_node))
-         {
-           /* ???  Do not use convert () here or fold arbitrary trees
-              since folding can introduce tree sharing which is not
-              allowed during gimplification.  */
-           if (TREE_CODE (*op1_p) == INTEGER_CST)
-             *op1_p = fold_convert (unsigned_type_node, *op1_p);
-           else
-             *op1_p = build1 (NOP_EXPR, unsigned_type_node, *op1_p);
-         }
+         /* Make sure to unshare the result, tree sharing is invalid
+            during gimplification.  */
+         *op1_p = unshare_expr (convert (unsigned_type_node, *op1_p));
        break;
       }