aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog14
-rw-r--r--gcc/c-family/c-gimplify.c4
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 7a83a0a9062..962f62844a3 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,17 @@
+2018-04-26 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 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
+ * c-gimplify.c (c_gimplify_expr): Do not fold expressions.
+
2018-03-03 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c
index 57edb41af0f..deecb1a3e4a 100644
--- a/gcc/c-family/c-gimplify.c
+++ b/gcc/c-family/c-gimplify.c
@@ -244,7 +244,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))
- *op1_p = convert (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;
}