aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ipa-param-manipulation.c4
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr103099.C25
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr103107.c17
-rw-r--r--gcc/tree-inline.c5
4 files changed, 48 insertions, 3 deletions
diff --git a/gcc/ipa-param-manipulation.c b/gcc/ipa-param-manipulation.c
index c84d669..44f3bed 100644
--- a/gcc/ipa-param-manipulation.c
+++ b/gcc/ipa-param-manipulation.c
@@ -1185,8 +1185,8 @@ ipa_param_body_adjustments::prepare_debug_expressions (tree dead_ssa)
return (*d != NULL_TREE);
}
- tree val = gimple_assign_rhs_to_tree (def);
- SET_EXPR_LOCATION (val, UNKNOWN_LOCATION);
+ tree val
+ = unshare_expr_without_location (gimple_assign_rhs_to_tree (def));
remap_with_debug_expressions (&val);
tree vexpr = make_node (DEBUG_EXPR_DECL);
diff --git a/gcc/testsuite/g++.dg/ipa/pr103099.C b/gcc/testsuite/g++.dg/ipa/pr103099.C
new file mode 100644
index 0000000..5fb137d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr103099.C
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+void pthread_mutex_unlock(int *);
+int __gthread_mutex_unlock___mutex, unlock___trans_tmp_1;
+struct Object {
+ void _change_notify() {}
+ bool _is_queued_for_deletion;
+};
+struct ClassDB {
+ template <class N, class M> static int bind_method(N, M);
+};
+struct CanvasItemMaterial : Object {
+ bool particles_animation;
+ void set_particles_animation(bool);
+};
+void CanvasItemMaterial::set_particles_animation(bool p_particles_anim) {
+ particles_animation = p_particles_anim;
+ if (unlock___trans_tmp_1)
+ pthread_mutex_unlock(&__gthread_mutex_unlock___mutex);
+ _change_notify();
+}
+void CanvasItemMaterial_bind_methods() {
+ ClassDB::bind_method("", &CanvasItemMaterial::set_particles_animation);
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/pr103107.c b/gcc/testsuite/gcc.dg/ipa/pr103107.c
new file mode 100644
index 0000000..3ea3fc5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr103107.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-Og -g -fipa-sra -fno-tree-dce" } */
+
+typedef int __attribute__((__vector_size__ (8))) V;
+V v;
+
+static void
+bar (int i)
+{
+ V l = v + i;
+}
+
+void
+foo (void)
+{
+ bar (0);
+}
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index d78e439..53d664e 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1825,7 +1825,10 @@ remap_gimple_stmt (gimple *stmt, copy_body_data *id)
tree value = gimple_debug_bind_get_value (stmt);
if (id->param_body_adjs
&& id->param_body_adjs->m_dead_stmts.contains (stmt))
- id->param_body_adjs->remap_with_debug_expressions (&value);
+ {
+ value = unshare_expr_without_location (value);
+ id->param_body_adjs->remap_with_debug_expressions (&value);
+ }
gdebug *copy = gimple_build_debug_bind (var, value, stmt);
if (id->reset_location)