aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2012-12-19 13:53:18 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-12-19 13:53:18 +0000
commitd1f985421fff69c6956206f9606c4a9e35b32a70 (patch)
tree16f545224cd8116189b4ccd1992329c439c78de9 /gcc/gimplify.c
parentc354951b7ef67f8bbbca3db79734db73880d17a2 (diff)
downloadgcc-d1f985421fff69c6956206f9606c4a9e35b32a70.zip
gcc-d1f985421fff69c6956206f9606c4a9e35b32a70.tar.gz
gcc-d1f985421fff69c6956206f9606c4a9e35b32a70.tar.bz2
re PR lto/55736 (lto ICE: tree code ''junl is not supported in LTO streams)
2012-12-19 Richard Biener <rguenther@suse.de> PR tree-optimization/55736 PR tree-optimization/55703 * gimplify.c (prune_expr_location): New function. (unshare_expr_without_location): Likewise. * tree.h (unshare_expr_without_location): Declare. * ipa-prop.c (prune_expression_for_jf): Remove. (prune_expression_for_jf_1): Likewise. (ipa_set_jf_constant): Use unshare_expr_without_location. (ipa_set_jf_arith_pass_through): Likewise. (determine_known_aggregate_parts): Likewise. * tree-switch-conversion.c (build_constructors): Use unshare_expr_without_location on all constructor elements. * gcc.dg/lto/pr55703_0.c: New testcase. From-SVN: r194609
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 384adb2..f628b8a 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1059,6 +1059,30 @@ unshare_expr (tree expr)
walk_tree (&expr, mostly_copy_tree_r, NULL, NULL);
return expr;
}
+
+/* Worker for unshare_expr_without_location. */
+
+static tree
+prune_expr_location (tree *tp, int *walk_subtrees, void *)
+{
+ if (EXPR_P (*tp))
+ SET_EXPR_LOCATION (*tp, UNKNOWN_LOCATION);
+ else
+ *walk_subtrees = 0;
+ return NULL_TREE;
+}
+
+/* Similar to unshare_expr but also prune all expression locations
+ from EXPR. */
+
+tree
+unshare_expr_without_location (tree expr)
+{
+ walk_tree (&expr, mostly_copy_tree_r, NULL, NULL);
+ if (EXPR_P (expr))
+ walk_tree (&expr, prune_expr_location, NULL, NULL);
+ return expr;
+}
/* WRAPPER is a code such as BIND_EXPR or CLEANUP_POINT_EXPR which can both
contain statements and have a value. Assign its value to a temporary