[committed] Fix a warning in omp-low.c

2016-01-20 Thread Jakub Jelinek
Hi!

richi reported a warning in omp-low.c with some configure options (forgot
which), this patch ensures we don't warn.
Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk.

2016-01-21  Jakub Jelinek  

* omp-low.c (expand_omp_target): Avoid -Wmaybe-uninitialized
warning.  Fix up formatting.

--- gcc/omp-low.c.jj2016-01-19 09:20:27.0 +0100
+++ gcc/omp-low.c   2016-01-19 11:37:05.053243550 +0100
@@ -13033,21 +13033,20 @@ expand_omp_target (struct omp_region *re
 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);

Jakub


[committed] Fix a warning in omp-low.c

2016-01-17 Thread Jakub Jelinek
Hi!

This fixes a warning in mark_loops_in_oacc_kernels_region.
Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk.

2016-01-17  Jakub Jelinek  

* omp-low.c (mark_loops_in_oacc_kernels_region): Work around
-Wmaybe-uninitialized warning.

--- gcc/omp-low.c.jj2016-01-14 22:31:22.0 +0100
+++ gcc/omp-low.c   2016-01-16 11:30:49.321974885 +0100
@@ -12539,7 +12539,7 @@ mark_loops_in_oacc_kernels_region (basic
   /* Don't parallelize the kernels region if it contains more than one outer
  loop.  */
   unsigned int nr_outer_loops = 0;
-  struct loop *single_outer;
+  struct loop *single_outer = NULL;
   for (struct loop *loop = outer->inner; loop != NULL; loop = loop->next)
 {
   gcc_assert (loop_outer (loop) == outer);

Jakub