Add clobber for object, after last use.
authortschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Feb 2014 14:46:19 +0000 (14:46 +0000)
committertschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Feb 2014 14:46:19 +0000 (14:46 +0000)
gcc/
* omp-low.c (lower_omp_target): Add clobber for sizes array, after
last use.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207723 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/omp-low.c

index 78bf506..25f1bf4 100644 (file)
@@ -1,5 +1,8 @@
 2014-02-12  Thomas Schwinge  <thomas@codesourcery.com>
 
+       * omp-low.c (lower_omp_target): Add clobber for sizes array, after
+       last use.
+
        * omp-low.c (diagnose_sb_0): Make sure label_ctx is valid to
        dereference.
 
index ff3d2e8..e7fc730 100644 (file)
@@ -9812,6 +9812,13 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
                                        TREE_VEC_ELT (t, 1)),
                                &initlist, true, NULL_TREE);
          gimple_seq_add_seq (&ilist, initlist);
+
+         tree clobber = build_constructor (TREE_TYPE (TREE_VEC_ELT (t, 1)),
+                                           NULL);
+         TREE_THIS_VOLATILE (clobber) = 1;
+         gimple_seq_add_stmt (&olist,
+                              gimple_build_assign (TREE_VEC_ELT (t, 1),
+                                                   clobber));
        }
 
       tree clobber = build_constructor (ctx->record_type, NULL);