aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2014-09-22 12:32:09 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2014-09-22 12:32:09 +0200
commit932b6d616159e9f3d29d2eb04cb6c7915f28d752 (patch)
tree00fda6c814ded50dff11395fc813816db74a48e4 /gcc/omp-low.c
parent1091cf49338277a7b075588c4ecfd35653fc650e (diff)
downloadgcc-932b6d616159e9f3d29d2eb04cb6c7915f28d752.zip
gcc-932b6d616159e9f3d29d2eb04cb6c7915f28d752.tar.gz
gcc-932b6d616159e9f3d29d2eb04cb6c7915f28d752.tar.bz2
re PR debug/63328 (c-c++-common/gomp/pr60823-3.c test fails with -fcompare-debug)
PR debug/63328 * omp-low.c (ipa_simd_modify_stmt_ops): For debug stmts insert a debug source bind stmt setting DEBUG_EXPR_DECL instead of a normal gimple assignment stmt. * c-c++-common/gomp/pr63328.c: New test. From-SVN: r215454
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index be882f7..82651ea 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -11717,9 +11717,22 @@ ipa_simd_modify_stmt_ops (tree *tp, int *walk_subtrees, void *data)
if (tp != orig_tp)
{
repl = build_fold_addr_expr (repl);
- gimple stmt
- = gimple_build_assign (make_ssa_name (TREE_TYPE (repl), NULL), repl);
- repl = gimple_assign_lhs (stmt);
+ gimple stmt;
+ if (is_gimple_debug (info->stmt))
+ {
+ tree vexpr = make_node (DEBUG_EXPR_DECL);
+ stmt = gimple_build_debug_source_bind (vexpr, repl, NULL);
+ DECL_ARTIFICIAL (vexpr) = 1;
+ TREE_TYPE (vexpr) = TREE_TYPE (repl);
+ DECL_MODE (vexpr) = TYPE_MODE (TREE_TYPE (repl));
+ repl = vexpr;
+ }
+ else
+ {
+ stmt = gimple_build_assign (make_ssa_name (TREE_TYPE (repl),
+ NULL), repl);
+ repl = gimple_assign_lhs (stmt);
+ }
gimple_stmt_iterator gsi = gsi_for_stmt (info->stmt);
gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
*orig_tp = repl;