]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
omp-low.c (expand_omp_target): Avoid -Wmaybe-uninitialized warning.
authorJakub Jelinek <jakub@redhat.com>
Wed, 20 Jan 2016 23:55:38 +0000 (00:55 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 20 Jan 2016 23:55:38 +0000 (00:55 +0100)
* omp-low.c (expand_omp_target): Avoid -Wmaybe-uninitialized
warning.  Fix up formatting.

From-SVN: r232641

gcc/ChangeLog
gcc/omp-low.c

index 06aae56d64ed09415942a9ce1bdc1c7959350e76..f20b9b632110a312a6513eac48f94c036235e3b3 100644 (file)
@@ -1,5 +1,8 @@
 2016-01-21  Jakub Jelinek  <jakub@redhat.com>
 
+       * omp-low.c (expand_omp_target): Avoid -Wmaybe-uninitialized
+       warning.  Fix up formatting.
+
        PR middle-end/67653
        * gimplify.c (gimplify_asm_expr): Warn if it is too late to
        attempt to mark memory input operand addressable and
index 673dee34e21e40a7e1a4cd68594d6d86e12aa5ca..29770820a06b6f73147582868b809ebac9829410 100644 (file)
@@ -13328,21 +13328,20 @@ expand_omp_target (struct omp_region *region)
                                                     GOMP_ASYNC_SYNC));
        if (tagging && t_async)
          {
-           unsigned HOST_WIDE_INT i_async;
+           unsigned HOST_WIDE_INT i_async = GOMP_LAUNCH_OP_MAX;
 
            if (TREE_CODE (t_async) == INTEGER_CST)
              {
                /* See if we can pack the async arg in to the tag's
                   operand.  */
                i_async = TREE_INT_CST_LOW (t_async);
-
                if (i_async < GOMP_LAUNCH_OP_MAX)
                  t_async = NULL_TREE;
+               else
+                 i_async = GOMP_LAUNCH_OP_MAX;
              }
-           if (t_async)
-             i_async = GOMP_LAUNCH_OP_MAX;
-           args.safe_push (oacc_launch_pack
-                           (GOMP_LAUNCH_ASYNC, NULL_TREE, i_async));
+           args.safe_push (oacc_launch_pack (GOMP_LAUNCH_ASYNC, NULL_TREE,
+                                             i_async));
          }
        if (t_async)
          args.safe_push (t_async);